diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index ce0a8b7fd7f0..13085d077ec2 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -1,11 +1,11 @@ { - "commit": "8a20cee044fafde7ae0364edab45a577aa80d20f", + "commit": "f20c8fce685cff482afb864043175e5d806f02c2", "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/sql/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/sql/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/sql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py index 2bf6ccd2d152..5de83eadd832 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__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/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py index e87ddb448728..3a167186aac7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py @@ -44,10 +44,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-sql/{}".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/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py index 7c1dedb5133d..2c170e28dbca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_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/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py index 88aaeedbc59a..0fa429da8c90 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_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 SqlManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -598,7 +598,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 @@ -1016,15 +1016,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: () -> SqlManagementClient + def __enter__(self) -> "SqlManagementClient": 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/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py index 1e4f07ee570f..c78e629b6f08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0b5" +VERSION = "0.9.0" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py index a1456e6ead0b..ae0c78dc1ab2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/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/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py index 7f5364616f0a..b276f0d214d9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_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 SqlManagementClientConfiguration from .operations import ( @@ -604,7 +604,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/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py index f6785e094a7f..6f4b420e6fd9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py @@ -183,7 +183,7 @@ from ._virtual_clusters_operations import VirtualClustersOperations 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/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py index cd4532004062..84c7536e6327 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,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 ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - 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.BackupShortTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -371,7 +375,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: @@ -383,9 +387,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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,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 ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - 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.BackupShortTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -620,7 +628,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: @@ -632,9 +640,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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -659,10 +669,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -699,13 +709,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", 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 @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py index 2c6b510335b6..c89a7b62560e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py @@ -84,10 +84,10 @@ async def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationCapabilities] + ) + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( location_name=location_name, @@ -99,9 +99,9 @@ async def list_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 ) @@ -118,4 +118,6 @@ async def list_by_location( return deserialized - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py index 6d19f1b3c3ee..794f0634584f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py @@ -169,10 +169,10 @@ async def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -197,9 +197,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -216,7 +216,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } @distributed_trace_async async def get( @@ -251,9 +253,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -267,9 +269,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 ) @@ -286,4 +288,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py index f97fd617146c..c760c8c07dee 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py @@ -182,10 +182,10 @@ async def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRule] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -211,9 +211,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -230,11 +230,13 @@ async def create_or_update( deserialized = self._deserialize("DataMaskingRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" + } @distributed_trace def list_by_database( @@ -261,9 +263,9 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRuleListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -288,12 +290,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DataMaskingRuleListResult", 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 @@ -320,4 +322,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py index bc00fbabd1e8..432609ae60b2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivities] + ) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}" + } @distributed_trace def list_by_database( @@ -156,10 +158,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivitiesListResult] + ) + cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -183,12 +185,12 @@ 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: request = HttpRequest("GET", next_link) 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 +198,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DataWarehouseUserActivitiesListResult", 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 @@ -215,4 +217,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py index b1d34b06c220..19ff93a116e3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAdvancedThreatProtectionListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -183,10 +185,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -200,9 +202,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 ) @@ -219,7 +221,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def create_or_update( @@ -338,11 +342,11 @@ async def 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -367,9 +371,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -386,8 +390,10 @@ async def create_or_update( deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py index 234f74971bde..d50a1e2bdaca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py @@ -95,10 +95,10 @@ async def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def list_by_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 ) @@ -131,7 +131,9 @@ async def list_by_database( return deserialized - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors" + } @distributed_trace_async async def get( @@ -164,10 +166,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -181,9 +183,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 ) @@ -200,7 +202,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } @overload async def update( @@ -313,11 +317,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -342,9 +346,9 @@ async def update( params=_params, ) 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 ) @@ -361,4 +365,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py index d260e763ca4a..85f86315a1d6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py @@ -84,10 +84,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -100,9 +100,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 ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } @overload async def update( @@ -223,11 +225,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -251,9 +253,9 @@ async def update( params=_params, ) 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 ) @@ -270,4 +272,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py index b9cfff447085..80b4a994d2be 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseBlobAuditingPolicyListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings" + } @distributed_trace_async async def get( @@ -177,11 +179,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,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 ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } @overload async def create_or_update( @@ -327,12 +331,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -357,9 +361,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -376,8 +380,10 @@ async def create_or_update( deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py index 315c22ce8d78..a4ec4f9aa945 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py @@ -102,10 +102,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -134,12 +134,12 @@ 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: request = HttpRequest("GET", next_link) 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("DatabaseColumnListResult", 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 @@ -166,7 +166,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -203,10 +205,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -246,13 +248,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace_async async def get( @@ -309,10 +313,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +332,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 ) @@ -347,4 +351,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py index d35775bac591..4dcadbb5eb61 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py @@ -94,10 +94,10 @@ async def get( # 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,9 @@ async def get( # 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 ) @@ -126,7 +126,9 @@ async def get( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } async def _create_or_update_initial( self, @@ -148,11 +150,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,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 ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @overload async def begin_create_or_update( @@ -330,16 +334,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationResult] - 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.ImportExportExtensionsOperationResult] = 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, server_name=server_name, database_name=database_name, @@ -361,7 +365,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: @@ -373,9 +377,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.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @distributed_trace def list_by_database( @@ -400,10 +406,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationListResult] + ) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -427,12 +433,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -440,13 +446,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ImportExportExtensionsOperationListResult", 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 @@ -459,4 +465,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py index 30c0384e93a4..a324f4f1ba66 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py @@ -88,10 +88,10 @@ async def cancel( # 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def cancel( # 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 ) @@ -120,7 +120,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_database( @@ -143,10 +145,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseOperationListResult] + ) + cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -170,12 +172,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -183,13 +185,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseOperationListResult", 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 @@ -202,4 +204,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py index 7ce942b0d150..e6b06562b1b1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py @@ -90,10 +90,10 @@ async def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.RecommendedAction]] + ) + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -107,9 +107,9 @@ async def list_by_database_advisor( params=_params, ) 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 ) @@ -126,7 +126,9 @@ async def list_by_database_advisor( return deserialized - list_by_database_advisor.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions"} # type: ignore + list_by_database_advisor.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -185,9 +187,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 ) @@ -204,7 +206,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } @overload async def update( @@ -326,11 +330,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -356,9 +360,9 @@ async def update( params=_params, ) 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 ) @@ -375,4 +379,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py index ee8f7260286a..fad1bcb15f02 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py @@ -86,10 +86,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSchemaListResult", 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 @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,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 ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py index 31381e6a4bbb..76d77c1f4ae4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,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 ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) 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,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertListResult] + ) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -368,13 +372,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSecurityAlertListResult", 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 @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py index a246a9125c03..60f64db0bd1a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py @@ -92,10 +92,10 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,12 +120,12 @@ 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: request = HttpRequest("GET", next_link) 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): ) 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 @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace_async async def get( @@ -196,10 +198,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -214,9 +216,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 ) @@ -233,7 +235,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -360,11 +364,11 @@ async def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -390,9 +394,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -409,4 +413,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py index 5f0b9bbed80e..65a22237843e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -76,10 +76,10 @@ async def _execute_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -93,9 +93,9 @@ async def _execute_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 ) @@ -108,7 +108,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace_async async def begin_execute( @@ -146,13 +148,13 @@ async def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -172,7 +174,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: @@ -184,6 +186,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_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py index f501b767f6d1..9eef3f965243 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -96,10 +96,10 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,12 +125,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ async def extract_data(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 @@ -159,7 +159,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace_async async def get( @@ -204,10 +206,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -223,9 +225,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 ) @@ -242,7 +244,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload async def create_or_update( @@ -377,11 +381,11 @@ async def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -408,9 +412,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -427,7 +431,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -472,10 +478,10 @@ async def delete( # 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -491,9 +497,9 @@ async def delete( # 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,4 +512,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py index a8fd42d5f736..fde1419788f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -96,10 +96,10 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,12 +125,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -138,13 +138,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", 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 @@ -157,7 +157,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace_async async def get( @@ -204,10 +206,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -223,9 +225,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 ) @@ -242,4 +244,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py index 73bcd0631e8c..27864bf6c9d7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -91,10 +91,10 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -119,12 +119,12 @@ 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: request = HttpRequest("GET", next_link) 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("SqlVulnerabilityAssessmentScanRecordListResult", 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 @@ -151,7 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -211,9 +213,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 ) @@ -230,4 +232,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py index 65fc3a7c09a7..861d25766058 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -83,10 +83,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + } @distributed_trace_async async def get( @@ -182,10 +184,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,9 +201,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 ) @@ -218,4 +220,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py index 31c7695fa5e2..518fe561c410 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py @@ -89,10 +89,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ 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: request = HttpRequest("GET", next_link) 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("DatabaseTableListResult", 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 @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace_async async def get( @@ -191,10 +193,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = 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 ) @@ -228,4 +230,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py index d5674dffa20c..390d0315b5b9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py @@ -77,10 +77,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseUsageListResult] + ) + cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseUsageListResult", 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 @@ -136,4 +136,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py index 322b95b3f399..89adc592ca6a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py @@ -105,10 +105,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -124,9 +124,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 ) @@ -143,7 +143,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -286,11 +288,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -317,9 +319,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -336,7 +338,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -384,10 +388,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -403,9 +407,9 @@ async def delete( # 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 ) @@ -418,4 +422,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py index 7ea26b43eb03..cfafef8928a1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py @@ -84,10 +84,10 @@ async def _initiate_scan_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -102,9 +102,9 @@ async def _initiate_scan_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 ) @@ -117,7 +117,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def begin_initiate_scan( @@ -158,13 +160,13 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -185,7 +187,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: @@ -197,9 +199,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_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def list_by_database( @@ -232,10 +236,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,12 +264,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -273,13 +277,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", 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 @@ -292,7 +296,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -334,10 +340,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -352,9 +358,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 ) @@ -371,7 +377,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } @distributed_trace_async async def export( @@ -413,10 +421,10 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -431,9 +439,9 @@ async def export( params=_params, ) 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 ) @@ -450,8 +458,10 @@ async def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py index 6047cdd8db3d..f317a7c33e2c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -254,11 +256,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -283,9 +285,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -302,11 +304,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -346,10 +350,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -363,9 +367,9 @@ async def delete( # 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 ) @@ -378,7 +382,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -404,10 +410,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -431,12 +437,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -444,13 +450,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", 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 @@ -463,4 +469,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py index 91bcf2d15cdc..e499327871f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py @@ -100,8 +100,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -126,12 +126,12 @@ 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: request = HttpRequest("GET", next_link) 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.Sql/servers/{serverName}/databases/{databaseName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -181,8 +183,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +208,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -219,13 +221,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionListResult", 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 @@ -238,7 +240,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -261,10 +265,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -288,12 +292,12 @@ 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: request = HttpRequest("GET", next_link) 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 +305,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -320,7 +324,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases" + } @distributed_trace_async async def get( @@ -351,10 +357,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -367,9 +373,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 ) @@ -386,7 +392,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _create_or_update_initial( self, @@ -407,11 +415,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -435,9 +443,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 ) @@ -459,7 +467,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload async def begin_create_or_update( @@ -579,16 +589,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, server_name=server_name, database_name=database_name, @@ -609,7 +619,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: @@ -621,9 +631,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -639,10 +651,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -655,9 +667,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 ) @@ -670,7 +682,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @distributed_trace_async async def begin_delete( @@ -700,13 +714,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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, @@ -725,7 +739,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: @@ -737,9 +751,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _update_initial( self, @@ -760,11 +776,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -788,9 +804,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 ) @@ -809,7 +825,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload async def begin_update( @@ -929,16 +947,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, server_name=server_name, database_name=database_name, @@ -959,7 +977,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: @@ -971,9 +989,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _export_initial( self, @@ -994,11 +1014,11 @@ async def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1022,9 +1042,9 @@ async def _export_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 ) @@ -1043,7 +1063,9 @@ async def _export_initial( return deserialized - _export_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + _export_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } @overload async def begin_export( @@ -1163,16 +1185,16 @@ async def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( # type: ignore + raw_result = await self._export_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1193,7 +1215,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: @@ -1205,9 +1227,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_export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + begin_export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1228,10 +1252,10 @@ async def _failover_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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1245,9 +1269,9 @@ async def _failover_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 ) @@ -1260,7 +1284,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1298,13 +1324,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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_initial( # type: ignore resource_group_name=resource_group_name, @@ -1324,7 +1350,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: @@ -1336,9 +1362,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.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } async def _import_method_initial( self, @@ -1359,11 +1387,11 @@ async def _import_method_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1387,9 +1415,9 @@ async def _import_method_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 ) @@ -1408,7 +1436,9 @@ async def _import_method_initial( return deserialized - _import_method_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + _import_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload async def begin_import_method( @@ -1528,16 +1558,16 @@ async def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( # type: ignore + raw_result = await self._import_method_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1558,7 +1588,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: @@ -1570,9 +1600,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_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + begin_import_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload async def rename( # pylint: disable=inconsistent-return-statements @@ -1676,11 +1708,11 @@ async def rename( # 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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 @@ -1704,9 +1736,9 @@ async def rename( # 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 ) @@ -1719,7 +1751,9 @@ async def rename( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - rename.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move"} # type: ignore + rename.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move" + } async def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1735,10 +1769,10 @@ async def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -1751,9 +1785,9 @@ async def _pause_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 ) @@ -1772,7 +1806,9 @@ async def _pause_initial( return deserialized - _pause_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } @distributed_trace_async async def begin_pause( @@ -1803,15 +1839,15 @@ async def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = 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._pause_initial( # type: ignore + raw_result = await self._pause_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1830,7 +1866,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: @@ -1842,9 +1878,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_pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } async def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1860,10 +1898,10 @@ async def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -1876,9 +1914,9 @@ async def _resume_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 ) @@ -1897,7 +1935,9 @@ async def _resume_initial( return deserialized - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } @distributed_trace_async async def begin_resume( @@ -1928,15 +1968,15 @@ async def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = 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._resume_initial( # type: ignore + raw_result = await self._resume_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1955,7 +1995,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: @@ -1967,9 +2007,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_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1985,10 +2027,10 @@ async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( resource_group_name=resource_group_name, @@ -2001,9 +2043,9 @@ async def _upgrade_data_warehouse_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 ) @@ -2016,7 +2058,9 @@ async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _upgrade_data_warehouse_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + _upgrade_data_warehouse_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace_async async def begin_upgrade_data_warehouse( @@ -2046,13 +2090,13 @@ async def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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._upgrade_data_warehouse_initial( # type: ignore resource_group_name=resource_group_name, @@ -2071,7 +2115,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: @@ -2083,9 +2127,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_upgrade_data_warehouse.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + begin_upgrade_data_warehouse.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def list_by_elastic_pool( @@ -2108,10 +2154,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2135,12 +2181,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2148,13 +2194,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -2167,7 +2213,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases" + } @distributed_trace def list_inaccessible_by_server( @@ -2188,10 +2236,10 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2214,12 +2262,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2227,13 +2275,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -2246,4 +2294,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_inaccessible_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases"} # type: ignore + list_inaccessible_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py index 03b5c41405a0..4133f263741a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py @@ -76,10 +76,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,12 +100,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -113,13 +113,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DeletedServerListResult", 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 @@ -132,7 +132,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} @distributed_trace_async async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: @@ -158,10 +158,10 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] + ) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -173,9 +173,9 @@ async def get(self, location_name: str, deleted_server_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 ) @@ -192,7 +192,9 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}" + } @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: @@ -208,10 +210,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -246,13 +248,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DeletedServerListResult", 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 @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers" + } async def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any @@ -281,10 +285,10 @@ async def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DeletedServer]] + ) + cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( location_name=location_name, @@ -296,9 +300,9 @@ async def _recover_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 ) @@ -317,7 +321,9 @@ async def _recover_initial( return deserialized - _recover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + _recover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } @distributed_trace_async async def begin_recover( @@ -345,15 +351,15 @@ async def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.DeletedServer] = 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._recover_initial( # type: ignore + raw_result = await self._recover_initial( location_name=location_name, deleted_server_name=deleted_server_name, api_version=api_version, @@ -371,7 +377,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: @@ -383,6 +389,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_recover.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + begin_recover.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py index 7e5c10156509..37fadfa572c8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py @@ -86,10 +86,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroupsListResult] + ) + cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,12 +112,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -125,13 +125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DistributedAvailabilityGroupsListResult", 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 @@ -144,7 +144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] + ) + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,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 ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,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 ) @@ -287,7 +291,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - 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.DistributedAvailabilityGroup] = 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, managed_instance_name=managed_instance_name, distributed_availability_group_name=distributed_availability_group_name, @@ -437,7 +443,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: @@ -449,9 +455,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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,9 +583,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = 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 ) @@ -645,7 +657,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload async def begin_update( @@ -765,16 +779,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - 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.DistributedAvailabilityGroup] = 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, managed_instance_name=managed_instance_name, distributed_availability_group_name=distributed_availability_group_name, @@ -795,7 +809,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: @@ -807,6 +821,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py index 7b33f6df7dc7..6955774e4ebf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py @@ -78,8 +78,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,12 +103,12 @@ 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: request = HttpRequest("GET", next_link) 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("ElasticPoolActivityListResult", 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 @@ -135,4 +135,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py index ca2ab47408af..621fa11b3182 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py @@ -79,8 +79,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolDatabaseActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolDatabaseActivityListResult", 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 @@ -136,4 +136,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py index 3893b526480a..a44d67eca5b8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py @@ -88,10 +88,10 @@ async def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def cancel( # 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 ) @@ -120,7 +120,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_elastic_pool( @@ -144,10 +146,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolOperationListResult] + ) + cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +173,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -184,13 +186,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolOperationListResult", 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 @@ -203,4 +205,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py index 4bc8385ba762..69d3e8512e43 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py @@ -92,8 +92,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ 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: request = HttpRequest("GET", next_link) 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("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 @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -173,8 +175,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +200,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -211,13 +213,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionListResult", 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 @@ -230,7 +232,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -253,10 +257,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolListResult] + ) + cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -280,12 +284,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -293,13 +297,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolListResult", 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 @@ -312,7 +316,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools" + } @distributed_trace_async async def get( @@ -343,10 +349,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] + ) + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -359,9 +365,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 ) @@ -378,7 +384,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _create_or_update_initial( self, @@ -399,11 +407,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -427,9 +435,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 ) @@ -451,7 +459,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload async def begin_create_or_update( @@ -570,16 +580,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - 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.ElasticPool] = 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, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -600,7 +610,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: @@ -612,9 +622,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -630,10 +642,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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, @@ -646,9 +658,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 ) @@ -661,7 +673,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @distributed_trace_async async def begin_delete( @@ -691,13 +705,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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, @@ -716,7 +730,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: @@ -728,9 +742,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _update_initial( self, @@ -751,11 +767,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -779,9 +795,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 ) @@ -800,7 +816,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload async def begin_update( @@ -920,16 +938,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - 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.ElasticPool] = 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, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -950,7 +968,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: @@ -962,9 +980,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -980,10 +1000,10 @@ async def _failover_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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -996,9 +1016,9 @@ async def _failover_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 ) @@ -1011,7 +1031,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1041,13 +1063,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1066,7 +1088,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: @@ -1078,6 +1100,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py index ce10bf3cade2..3815694d765e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py @@ -83,10 +83,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtectorListResult] + ) + cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,12 +109,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -122,13 +122,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("EncryptionProtectorListResult", 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 @@ -141,7 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector" + } @distributed_trace_async async def get( @@ -177,10 +179,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] + ) + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,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 ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } async def _create_or_update_initial( self, @@ -233,11 +237,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.EncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -261,9 +265,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 ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } @overload async def begin_create_or_update( @@ -405,16 +411,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] - 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.EncryptionProtector] = 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, server_name=server_name, encryption_protector_name=encryption_protector_name, @@ -435,7 +441,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: @@ -447,9 +453,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.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } async def _revalidate_initial( # pylint: disable=inconsistent-return-statements self, @@ -469,10 +477,10 @@ async def _revalidate_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -485,9 +493,9 @@ async def _revalidate_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 ) @@ -500,7 +508,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace_async async def begin_revalidate( @@ -535,13 +545,13 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -560,7 +570,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: @@ -572,6 +582,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_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py index 728512c94834..6b118d1ce8b1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py @@ -76,10 +76,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificateListResult] + ) + cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -115,13 +115,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("EndpointCertificateListResult", 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 @@ -134,7 +134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates" + } @distributed_trace_async async def get( @@ -166,10 +168,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificate] + ) + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -182,9 +184,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 ) @@ -201,4 +203,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py index dcfbfbfeffe2..ed0238bb5dce 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicyListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings" + } @distributed_trace_async async def get( @@ -177,11 +179,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,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 ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload async def create_or_update( @@ -327,12 +331,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -357,9 +361,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -376,8 +380,10 @@ async def create_or_update( deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py index b748977dfe98..ffc1f5be5907 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ExtendedServerBlobAuditingPolicyListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings" + } @distributed_trace_async async def get( @@ -174,11 +176,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -191,9 +193,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 ) @@ -210,7 +212,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } async def _create_or_update_initial( self, @@ -230,12 +234,12 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,9 +263,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 ) @@ -280,7 +284,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload async def begin_create_or_update( @@ -403,17 +409,17 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] - 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.ExtendedServerBlobAuditingPolicy] = 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, server_name=server_name, parameters=parameters, @@ -434,7 +440,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: @@ -446,6 +452,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py index e71eb83355e2..b22fd56062e7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] + ) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,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 ) @@ -204,7 +206,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload async def begin_create_or_update( @@ -324,16 +328,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - 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.FailoverGroup] = 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, server_name=server_name, failover_group_name=failover_group_name, @@ -354,7 +358,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: @@ -366,9 +370,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -384,10 +390,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -400,9 +406,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 ) @@ -415,7 +421,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace_async async def begin_delete( @@ -445,13 +453,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -470,7 +478,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: @@ -482,9 +490,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _update_initial( self, @@ -505,11 +515,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -533,9 +543,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 ) @@ -554,7 +564,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload async def begin_update( @@ -674,16 +686,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - 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.FailoverGroup] = 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, server_name=server_name, failover_group_name=failover_group_name, @@ -704,7 +716,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: @@ -716,9 +728,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_server( @@ -739,10 +753,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroupListResult] + ) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -765,12 +779,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -778,13 +792,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("FailoverGroupListResult", 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 @@ -797,7 +811,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } async def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -813,10 +829,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -829,9 +845,9 @@ async def _failover_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 ) @@ -850,7 +866,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } @distributed_trace_async async def begin_failover( @@ -881,15 +899,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.FailoverGroup] = 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_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -908,7 +926,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: @@ -920,9 +938,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -938,10 +958,10 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -954,9 +974,9 @@ async def _force_failover_allow_data_loss_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 ) @@ -975,7 +995,9 @@ async def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_force_failover_allow_data_loss( @@ -1007,15 +1029,15 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.FailoverGroup] = 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._force_failover_allow_data_loss_initial( # type: ignore + raw_result = await self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -1034,7 +1056,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: @@ -1046,6 +1068,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_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py index 644e0bba485f..9d901ef0200f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py @@ -92,10 +92,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,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 ) @@ -127,7 +127,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @overload async def create_or_update( @@ -231,11 +233,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,9 +261,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -278,11 +280,13 @@ async def create_or_update( deserialized = self._deserialize("FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -313,10 +317,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -329,9 +333,9 @@ async def delete( # 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 ) @@ -344,7 +348,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def list_by_server( @@ -365,10 +371,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRuleListResult] + ) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -391,12 +397,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -404,13 +410,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("FirewallRuleListResult", 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 @@ -423,7 +429,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } @overload async def replace( @@ -513,11 +521,11 @@ async def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -540,9 +548,9 @@ async def replace( params=_params, ) 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 ) @@ -561,4 +569,6 @@ async def replace( return deserialized - replace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + replace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py index 07064e960627..8862cbec721f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py @@ -174,9 +174,9 @@ async def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -201,9 +201,9 @@ async def create_or_update( params=_params, ) 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,11 +220,13 @@ async def create_or_update( deserialized = self._deserialize("GeoBackupPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace_async async def get( @@ -262,8 +264,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -277,9 +279,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 ) @@ -296,7 +298,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def list_by_database( @@ -319,8 +323,8 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicyListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -344,12 +348,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -357,13 +361,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GeoBackupPolicyListResult", 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 @@ -376,4 +380,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py index 3957e33fbbf8..fd2dd4599320 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] + ) + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,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 ) @@ -130,7 +130,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } async def _create_or_update_initial( self, @@ -151,11 +153,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -179,9 +181,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 ) @@ -203,7 +205,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @overload async def begin_create_or_update( @@ -323,16 +327,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - 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.InstanceFailoverGroup] = 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, location_name=location_name, failover_group_name=failover_group_name, @@ -353,7 +357,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: @@ -365,9 +369,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -383,10 +389,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -399,9 +405,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 ) @@ -414,7 +420,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace_async async def begin_delete( @@ -444,13 +452,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -469,7 +477,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: @@ -481,9 +489,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_location( @@ -505,10 +515,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroupListResult] + ) + cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -531,12 +541,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -544,13 +554,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("InstanceFailoverGroupListResult", 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 @@ -563,7 +573,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups" + } async def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -579,10 +591,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -595,9 +607,9 @@ async def _failover_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 ) @@ -616,7 +628,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } @distributed_trace_async async def begin_failover( @@ -647,15 +661,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.InstanceFailoverGroup] = 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_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -674,7 +688,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: @@ -686,9 +700,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -704,10 +720,10 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -720,9 +736,9 @@ async def _force_failover_allow_data_loss_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 ) @@ -741,7 +757,9 @@ async def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_force_failover_allow_data_loss( @@ -773,15 +791,15 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( # type: ignore + raw_result = await self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -800,7 +818,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: @@ -812,6 +830,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_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py index 1112a17badea..46f45b9936e4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py @@ -91,10 +91,10 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] + ) + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -106,9 +106,9 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: params=_params, ) 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 ) @@ -125,7 +125,9 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _create_or_update_initial( self, @@ -145,11 +147,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -172,9 +174,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 ) @@ -196,7 +198,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload async def begin_create_or_update( @@ -307,16 +311,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - 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.InstancePool] = 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, instance_pool_name=instance_pool_name, parameters=parameters, @@ -336,7 +340,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: @@ -348,9 +352,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any @@ -366,10 +372,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -381,9 +387,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 ) @@ -396,7 +402,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.Sql/instancePools/{instancePoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace_async async def begin_delete( @@ -424,13 +432,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -448,7 +456,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: @@ -460,9 +468,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _update_initial( self, @@ -482,11 +492,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -509,9 +519,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 ) @@ -530,7 +540,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload async def begin_update( @@ -641,16 +653,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - 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.InstancePool] = 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, instance_pool_name=instance_pool_name, parameters=parameters, @@ -670,7 +682,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: @@ -682,9 +694,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: @@ -701,10 +715,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -726,12 +740,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -739,13 +753,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("InstancePoolListResult", 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 @@ -758,7 +772,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.Sql/instancePools"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: @@ -772,10 +788,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -796,12 +812,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -809,13 +825,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("InstancePoolListResult", 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 @@ -828,4 +844,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py index f9ccb487c123..907fb57d8fa2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py @@ -81,10 +81,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRuleListResult] + ) + cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -120,13 +120,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IPv6FirewallRuleListResult", 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 @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,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 ) @@ -205,7 +207,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @overload async def create_or_update( @@ -311,11 +315,11 @@ async def 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -339,9 +343,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -358,11 +362,13 @@ async def create_or_update( deserialized = self._deserialize("IPv6FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -393,10 +399,10 @@ async def delete( # 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -409,9 +415,9 @@ async def delete( # 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 ) @@ -424,4 +430,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py index 62c6b029a47d..320cc090ea29 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgentListResult] + ) + cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobAgentListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents" + } @distributed_trace_async async def get( @@ -173,10 +175,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] + ) + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -189,9 +191,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 ) @@ -208,7 +210,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _create_or_update_initial( self, @@ -229,11 +233,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -257,9 +261,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 ) @@ -281,7 +285,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload async def begin_create_or_update( @@ -401,16 +407,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - 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.JobAgent] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -431,7 +437,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: @@ -443,9 +449,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any @@ -461,10 +469,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -477,9 +485,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 ) @@ -492,7 +500,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @distributed_trace_async async def begin_delete( @@ -522,13 +532,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -547,7 +557,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: @@ -559,9 +569,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _update_initial( self, @@ -582,11 +594,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -610,9 +622,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 ) @@ -631,7 +643,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload async def begin_update( @@ -750,16 +764,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - 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.JobAgent] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -780,7 +794,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: @@ -792,6 +806,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py index 607887f5f741..846bd8d77d1d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredentialListResult] + ) + cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobCredentialListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,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 ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @overload async def create_or_update( @@ -324,11 +328,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -353,9 +357,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -372,11 +376,13 @@ async def create_or_update( deserialized = self._deserialize("JobCredential", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -409,10 +415,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -426,9 +432,9 @@ async def delete( # 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 ) @@ -441,4 +447,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py index 81085aa37ed0..9c81a398b72c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py @@ -118,10 +118,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -152,12 +152,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -184,7 +184,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions" + } @distributed_trace_async async def cancel( # pylint: disable=inconsistent-return-statements @@ -225,10 +227,10 @@ async def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -243,9 +245,9 @@ async def cancel( # 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 ) @@ -258,7 +260,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel" + } async def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -274,10 +278,10 @@ async def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( resource_group_name=resource_group_name, @@ -291,9 +295,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 ) @@ -312,7 +316,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace_async async def begin_create( @@ -345,15 +351,15 @@ async def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.JobExecution] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -373,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: @@ -385,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def list_by_job( @@ -443,10 +451,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -478,12 +486,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -491,13 +499,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -510,7 +518,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions" + } @distributed_trace_async async def get( @@ -551,10 +561,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -569,9 +579,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 ) @@ -588,7 +598,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } async def _create_or_update_initial( self, @@ -610,10 +622,10 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -628,9 +640,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 ) @@ -652,7 +664,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } @distributed_trace_async async def begin_create_or_update( @@ -693,15 +707,15 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.JobExecution] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -722,7 +736,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: @@ -734,6 +748,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py index b87e453b464f..61d854affd91 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py @@ -115,10 +115,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -151,12 +151,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -164,13 +164,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -183,7 +183,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps" + } @distributed_trace_async async def get( @@ -227,10 +229,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -246,9 +248,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 ) @@ -265,4 +267,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py index ae6c2311087d..38fc6fc14f90 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py @@ -95,10 +95,10 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,12 +124,12 @@ 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: request = HttpRequest("GET", next_link) 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("JobStepListResult", 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 @@ -156,7 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps"} # type: ignore + list_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps" + } @distributed_trace_async async def get_by_version( @@ -200,10 +202,10 @@ async def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( resource_group_name=resource_group_name, @@ -219,9 +221,9 @@ async def get_by_version( params=_params, ) 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 ) @@ -238,7 +240,9 @@ async def get_by_version( return deserialized - get_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}"} # type: ignore + get_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}" + } @distributed_trace def list_by_job( @@ -263,10 +267,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -291,12 +295,12 @@ 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: request = HttpRequest("GET", next_link) 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 +308,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobStepListResult", 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 @@ -323,7 +327,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps" + } @distributed_trace_async async def get( @@ -364,10 +370,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -382,9 +388,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 ) @@ -401,7 +407,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @overload async def create_or_update( @@ -523,11 +531,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -553,9 +561,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -572,11 +580,13 @@ async def create_or_update( deserialized = self._deserialize("JobStep", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -617,10 +627,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -635,9 +645,9 @@ async def delete( # 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 ) @@ -650,4 +660,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py index 70ac849b45ee..20a47305385d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py @@ -119,10 +119,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -155,12 +155,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -168,13 +168,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -187,7 +187,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets" + } @distributed_trace def list_by_step( @@ -249,10 +251,10 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -286,12 +288,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -299,13 +301,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -318,7 +320,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_step.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets"} # type: ignore + list_by_step.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets" + } @distributed_trace_async async def get( @@ -365,10 +369,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -385,9 +389,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 ) @@ -404,4 +408,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py index 702e560aa623..58e9eefd8bdb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroupListResult] + ) + cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobTargetGroupListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,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 ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @overload async def create_or_update( @@ -324,11 +328,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -353,9 +357,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -372,11 +376,13 @@ async def create_or_update( deserialized = self._deserialize("JobTargetGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -409,10 +415,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -426,9 +432,9 @@ async def delete( # 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 ) @@ -441,4 +447,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py index c29ccdc7e634..bab8e8386659 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py @@ -80,10 +80,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersionListResult] + ) + cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobVersionListResult", 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 @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions" + } @distributed_trace_async async def get( @@ -181,10 +183,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersion] + ) + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,9 +201,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 ) @@ -218,4 +220,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py index 1b4990bf9a63..71dcffe3d287 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobListResult] + ) + cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JobListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,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 ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @overload async def create_or_update( @@ -323,11 +327,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -352,9 +356,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -371,11 +375,13 @@ async def create_or_update( deserialized = self._deserialize("Job", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -408,10 +414,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -425,9 +431,9 @@ async def delete( # 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 ) @@ -440,4 +446,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py index 05622096e201..fb668b19bef2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] + ) + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } async def _create_or_update_initial( self, @@ -158,11 +160,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,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 ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @overload async def begin_create_or_update( @@ -339,16 +343,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - 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.LedgerDigestUploads] = 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, server_name=server_name, database_name=database_name, @@ -370,7 +374,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: @@ -382,9 +386,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.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @distributed_trace def list_by_database( @@ -407,10 +413,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploadsListResult] + ) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -434,12 +440,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -447,13 +453,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LedgerDigestUploadsListResult", 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 @@ -466,7 +472,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads" + } async def _disable_initial( self, @@ -487,10 +495,10 @@ async def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( resource_group_name=resource_group_name, @@ -504,9 +512,9 @@ async def _disable_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 ) @@ -525,7 +533,9 @@ async def _disable_initial( return deserialized - _disable_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + _disable_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } @distributed_trace_async async def begin_disable( @@ -564,15 +574,15 @@ async def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( # type: ignore + raw_result = await self._disable_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -592,7 +602,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: @@ -604,6 +614,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_disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + begin_disable.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py index c9ab12c092e0..b55da768e4fa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py @@ -94,11 +94,11 @@ async def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -123,9 +123,9 @@ async def _copy_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 ) @@ -144,7 +144,9 @@ async def _copy_initial( return deserialized - _copy_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload async def begin_copy( @@ -273,16 +275,16 @@ async def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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._copy_initial( # type: ignore + raw_result = await self._copy_initial( location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -304,7 +306,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: @@ -316,9 +318,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_copy.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } async def _update_initial( self, @@ -340,11 +344,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -369,9 +373,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 ) @@ -390,7 +394,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload async def begin_update( @@ -519,16 +525,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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( location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -550,7 +556,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: @@ -562,9 +568,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace_async async def get( @@ -601,10 +609,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -618,9 +626,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 ) @@ -637,7 +645,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -658,10 +668,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -675,9 +685,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 ) @@ -690,7 +700,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace_async async def begin_delete( @@ -726,13 +738,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 location_name=location_name, @@ -752,7 +764,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: @@ -764,9 +776,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -801,10 +815,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -830,12 +844,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -843,13 +857,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -862,7 +876,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_location( @@ -891,10 +907,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -918,12 +934,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -931,13 +947,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -950,7 +966,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_server( @@ -982,10 +1000,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1010,12 +1028,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1023,13 +1041,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1042,7 +1060,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } async def _copy_by_resource_group_initial( self, @@ -1065,11 +1085,11 @@ async def _copy_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1095,9 +1115,9 @@ async def _copy_by_resource_group_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 ) @@ -1116,7 +1136,9 @@ async def _copy_by_resource_group_initial( return deserialized - _copy_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload async def begin_copy_by_resource_group( @@ -1257,16 +1279,16 @@ async def begin_copy_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( # type: ignore + raw_result = await self._copy_by_resource_group_initial( resource_group_name=resource_group_name, location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, @@ -1289,7 +1311,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: @@ -1301,9 +1323,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_copy_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } async def _update_by_resource_group_initial( self, @@ -1326,11 +1350,11 @@ async def _update_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1356,9 +1380,9 @@ async def _update_by_resource_group_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 ) @@ -1377,7 +1401,9 @@ async def _update_by_resource_group_initial( return deserialized - _update_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload async def begin_update_by_resource_group( @@ -1518,16 +1544,16 @@ async def begin_update_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( # type: ignore + raw_result = await self._update_by_resource_group_initial( resource_group_name=resource_group_name, location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, @@ -1550,7 +1576,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: @@ -1562,9 +1588,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace_async async def get_by_resource_group( @@ -1605,10 +1633,10 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -1623,9 +1651,9 @@ async def get_by_resource_group( params=_params, ) 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 ) @@ -1642,7 +1670,9 @@ async def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -1664,10 +1694,10 @@ async def _delete_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -1682,9 +1712,9 @@ async def _delete_by_resource_group_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 ) @@ -1697,7 +1727,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace_async async def begin_delete_by_resource_group( @@ -1737,13 +1769,13 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -1764,7 +1796,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: @@ -1776,9 +1808,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -1817,10 +1851,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1847,12 +1881,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1860,13 +1894,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1879,7 +1913,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_location( @@ -1912,10 +1948,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1940,12 +1976,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1953,13 +1989,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1972,7 +2008,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_server( @@ -2008,10 +2046,10 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2037,12 +2075,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2050,13 +2088,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -2069,4 +2107,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py index acf5a47a751b..9ab8a60df092 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any @@ -152,10 +154,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -169,9 +171,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 ) @@ -184,7 +186,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace_async async def begin_delete( @@ -215,13 +219,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 location_name=location_name, @@ -241,7 +245,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: @@ -253,9 +257,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -291,10 +297,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -320,12 +326,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -333,13 +339,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -352,7 +358,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_instance( @@ -385,10 +393,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -413,12 +421,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -426,13 +434,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -445,7 +453,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_location( @@ -475,10 +485,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -502,12 +512,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -515,13 +525,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -534,7 +544,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace_async async def get_by_resource_group( @@ -575,10 +587,10 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -593,9 +605,9 @@ async def get_by_resource_group( params=_params, ) 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 ) @@ -612,7 +624,9 @@ async def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -634,10 +648,10 @@ async def _delete_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -652,9 +666,9 @@ async def _delete_by_resource_group_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 ) @@ -667,7 +681,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace_async async def begin_delete_by_resource_group( @@ -707,13 +723,13 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -734,7 +750,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: @@ -746,9 +762,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -788,10 +806,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -818,12 +836,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -831,13 +849,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -850,7 +868,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_instance( @@ -887,10 +907,10 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -916,12 +936,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -929,13 +949,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -948,7 +968,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_location( @@ -982,10 +1004,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1010,12 +1032,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1023,13 +1045,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -1042,4 +1064,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py index e24fe72e50dd..05c02c3a42b2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py @@ -99,10 +99,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] + ) + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -116,9 +116,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 ) @@ -135,7 +135,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -157,11 +159,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -186,9 +188,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 ) @@ -207,7 +209,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -336,16 +340,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] - 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.LongTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -367,7 +371,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: @@ -379,9 +383,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.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -405,10 +411,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -432,12 +438,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -445,13 +451,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionPolicyListResult", 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 @@ -464,4 +470,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py index 161eb056735e..3c96562c62a3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py @@ -92,10 +92,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindowOptions] + ) + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,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 ) @@ -128,4 +128,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py index 2777bf547e4e..62beff697cd4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py @@ -91,10 +91,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindows] + ) + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,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 ) @@ -127,7 +127,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } @overload async def create_or_update( # pylint: disable=inconsistent-return-statements @@ -239,11 +241,11 @@ async def create_or_update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -268,9 +270,9 @@ async def create_or_update( # 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 ) @@ -283,4 +285,6 @@ async def create_or_update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py index 4608ce6a868a..8821b224a806 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,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 ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -371,7 +375,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: @@ -383,9 +387,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,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 ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -620,7 +628,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: @@ -632,9 +640,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -659,10 +669,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -699,13 +709,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", 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 @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py index d648bcbca7a7..15f8c5470e20 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtectionListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -183,10 +185,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -200,9 +202,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 ) @@ -219,7 +221,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def create_or_update( @@ -338,11 +342,11 @@ async def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -367,9 +371,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -386,8 +390,10 @@ async def create_or_update( deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py index 5cae5cf300e0..1e8e79ef1a88 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py @@ -102,10 +102,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -134,12 +134,12 @@ 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: request = HttpRequest("GET", next_link) 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("DatabaseColumnListResult", 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 @@ -166,7 +166,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -203,10 +205,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -246,13 +248,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace_async async def get( @@ -309,10 +313,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +332,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 ) @@ -347,4 +351,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py index 07f29092e185..babe41bf2da3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py @@ -89,10 +89,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationListResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,12 +117,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -130,13 +130,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseMoveOperationListResult", 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 @@ -149,7 +149,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + } @distributed_trace_async async def get( @@ -180,10 +182,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,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 ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py index 49026445b8f2..790b81c3d530 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py @@ -88,10 +88,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQuery] + ) + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -105,9 +105,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 ) @@ -124,7 +124,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}" + } @distributed_trace def list_by_query( @@ -164,10 +166,10 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQueryStatistics] + ) + cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -195,12 +197,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -208,13 +210,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceQueryStatistics", 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 @@ -227,4 +229,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_query.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics"} # type: ignore + list_by_query.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py index 5e4fe20e92b0..2e09603b32a1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py @@ -156,11 +156,11 @@ async def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -184,9 +184,9 @@ async def update( # 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 ) @@ -199,4 +199,6 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py index 0680134235de..1acf639ad82d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py @@ -91,10 +91,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseRestoreDetailsResult] + ) + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,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 ) @@ -127,4 +127,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py index bed227024632..ba60239a2d71 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py @@ -86,10 +86,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSchemaListResult", 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 @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,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 ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py index 7367e3b3b3f9..933f5e68e316 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,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 ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) 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,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -368,13 +372,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", 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 @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py index e16dccde5bed..09ea19948835 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py @@ -96,10 +96,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityEventCollection] + ) + cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -127,12 +127,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityEventCollection", 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 @@ -159,4 +159,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py index 5c167605498b..9f159dca7d08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py @@ -112,10 +112,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -132,9 +132,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 ) @@ -151,7 +151,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload async def create_or_update( @@ -291,12 +293,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -324,9 +326,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -343,11 +345,13 @@ async def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -394,11 +398,11 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -415,9 +419,9 @@ async def delete( # 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 ) @@ -430,7 +434,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -477,11 +483,11 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -498,9 +504,9 @@ async def disable_recommendation( # 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 ) @@ -513,7 +519,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace_async async def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -561,11 +569,11 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -582,9 +590,9 @@ async def enable_recommendation( # 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 ) @@ -597,7 +605,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def list_current_by_database( @@ -634,10 +644,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -664,12 +674,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -677,13 +687,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -696,7 +706,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @overload async def update( # pylint: disable=inconsistent-return-statements @@ -799,11 +811,11 @@ async def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -827,9 +839,9 @@ async def update( # 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 ) @@ -842,7 +854,9 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -880,10 +894,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -910,12 +924,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -923,13 +937,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -942,4 +956,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py index 175c0825ca9d..d621e88869ff 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py @@ -89,10 +89,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ 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: request = HttpRequest("GET", next_link) 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("DatabaseTableListResult", 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 @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace_async async def get( @@ -191,10 +193,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = 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 ) @@ -228,4 +230,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py index 2f66b74d695d..6a77e5b47902 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,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 ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) 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,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -368,13 +372,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", 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 @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py index d4fbbd833821..810305078cdb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -105,10 +105,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -124,9 +124,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 ) @@ -143,7 +143,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -286,11 +288,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -317,9 +319,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -336,7 +338,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -384,10 +388,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -403,9 +407,9 @@ async def delete( # 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 ) @@ -418,4 +422,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py index 2c09b21a88e1..fba39de85dc2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -84,10 +84,10 @@ async def _initiate_scan_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -102,9 +102,9 @@ async def _initiate_scan_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 ) @@ -117,7 +117,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def begin_initiate_scan( @@ -158,13 +160,13 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -185,7 +187,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: @@ -197,9 +199,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_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def export( @@ -241,10 +245,10 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -259,9 +263,9 @@ async def export( params=_params, ) 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 ) @@ -278,11 +282,13 @@ async def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } @distributed_trace def list_by_database( @@ -315,10 +321,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -343,12 +349,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -356,13 +362,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", 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 @@ -375,7 +381,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -417,10 +425,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -435,9 +443,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 ) @@ -454,4 +462,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py index 2340a864e96b..662af85265ac 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -254,11 +256,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -283,9 +285,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -302,11 +304,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -346,10 +350,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -363,9 +367,9 @@ async def delete( # 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 ) @@ -378,7 +382,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -404,10 +410,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -431,12 +437,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -444,13 +450,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", 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 @@ -463,4 +469,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py index 45c53f7d7165..b5a33191c909 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py @@ -89,10 +89,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,12 +115,12 @@ 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: request = HttpRequest("GET", next_link) 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("ManagedDatabaseListResult", 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 @@ -147,7 +147,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases" + } @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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] + ) + cls: ClsType[_models.ManagedDatabase] = 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,7 +215,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _create_or_update_initial( self, @@ -234,11 +238,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -262,9 +266,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 ) @@ -286,7 +290,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload async def begin_create_or_update( @@ -406,16 +412,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - 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.ManagedDatabase] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -436,7 +442,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: @@ -448,9 +454,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any @@ -466,10 +474,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -482,9 +490,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 ) @@ -497,7 +505,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @distributed_trace_async async def begin_delete( @@ -527,13 +537,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -552,7 +562,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: @@ -564,9 +574,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _update_initial( self, @@ -587,11 +599,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -615,9 +627,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 ) @@ -636,7 +648,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload async def begin_update( @@ -756,16 +770,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - 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.ManagedDatabase] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -786,7 +800,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: @@ -798,9 +812,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _cancel_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -821,11 +837,11 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -849,9 +865,9 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement params=_params, ) 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 ) @@ -864,7 +880,9 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - _cancel_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + _cancel_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } @overload async def begin_cancel_move( @@ -981,14 +999,14 @@ async def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._cancel_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1009,7 +1027,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: @@ -1021,9 +1039,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_cancel_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + begin_cancel_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } async def _complete_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1044,11 +1064,11 @@ async def _complete_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1072,9 +1092,9 @@ async def _complete_move_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 ) @@ -1087,7 +1107,9 @@ async def _complete_move_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _complete_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + _complete_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } @overload async def begin_complete_move( @@ -1204,14 +1226,14 @@ async def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._complete_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1232,7 +1254,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: @@ -1244,9 +1266,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_complete_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + begin_complete_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } async def _complete_restore_initial( # pylint: disable=inconsistent-return-statements self, @@ -1267,11 +1291,11 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1295,9 +1319,9 @@ async def _complete_restore_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 = 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 ) @@ -1310,7 +1334,9 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _complete_restore_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + _complete_restore_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } @overload async def begin_complete_restore( @@ -1429,14 +1455,14 @@ async def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._complete_restore_initial( # type: ignore resource_group_name=resource_group_name, @@ -1457,7 +1483,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: @@ -1469,9 +1495,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_complete_restore.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + begin_complete_restore.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } async def _start_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1492,11 +1520,11 @@ async def _start_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1520,9 +1548,9 @@ async def _start_move_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 ) @@ -1535,7 +1563,9 @@ async def _start_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + _start_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @overload async def begin_start_move( @@ -1652,14 +1682,14 @@ async def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._start_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1680,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: @@ -1692,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_start_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + begin_start_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @distributed_trace def list_inaccessible_by_instance( @@ -1715,10 +1747,10 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1741,12 +1773,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1754,13 +1786,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseListResult", 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 @@ -1773,4 +1805,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_inaccessible_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases"} # type: ignore + list_inaccessible_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py index 90062dde5562..1f1f7ed8645c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py @@ -85,10 +85,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministratorListResult] + ) + cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAdministratorListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators" + } @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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] + ) + cls: ClsType[_models.ManagedInstanceAdministrator] = 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,7 +215,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } async def _create_or_update_initial( self, @@ -234,11 +238,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -262,9 +266,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 ) @@ -286,7 +290,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @overload async def begin_create_or_update( @@ -406,16 +412,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] - 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.ManagedInstanceAdministrator] = 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, managed_instance_name=managed_instance_name, administrator_name=administrator_name, @@ -436,7 +442,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: @@ -448,9 +454,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -470,10 +478,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -486,9 +494,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 ) @@ -501,7 +509,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @distributed_trace_async async def begin_delete( @@ -535,13 +545,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -560,7 +570,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: @@ -572,6 +582,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py index 0a921f14761b..784e962e0311 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py @@ -84,10 +84,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtectionListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -179,10 +181,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,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 ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,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 ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def begin_create_or_update( @@ -413,16 +419,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] - 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.ManagedInstanceAdvancedThreatProtection] = 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, managed_instance_name=managed_instance_name, advanced_threat_protection_name=advanced_threat_protection_name, @@ -443,7 +449,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: @@ -455,6 +461,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py index 01506a609fa5..f212cdf88b7b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,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 ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,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 ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @overload async def begin_create_or_update( @@ -337,16 +341,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] - 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.ManagedInstanceAzureADOnlyAuthentication] = 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, managed_instance_name=managed_instance_name, authentication_name=authentication_name, @@ -367,7 +371,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: @@ -379,9 +383,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -401,10 +407,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -417,9 +423,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 ) @@ -432,7 +438,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace_async async def begin_delete( @@ -467,13 +475,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -492,7 +500,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: @@ -504,9 +512,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_instance( @@ -529,10 +539,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +565,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -568,13 +578,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", 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 @@ -587,4 +597,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py index 3ebb1ffa3098..7286d8b75e5d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py @@ -82,10 +82,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtcListResult] + ) + cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceDtcListResult", 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 @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + } @distributed_trace_async async def get( @@ -171,10 +173,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -187,9 +189,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 ) @@ -206,7 +208,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } async def _create_or_update_initial( self, @@ -227,11 +231,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -255,9 +259,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 ) @@ -274,7 +278,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } @overload async def begin_create_or_update( @@ -394,16 +400,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] - 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.ManagedInstanceDtc] = 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, managed_instance_name=managed_instance_name, dtc_name=dtc_name, @@ -424,7 +430,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: @@ -436,6 +442,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py index 445627b9bfd8..b7080b2d1d83 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py @@ -82,10 +82,10 @@ async def _revalidate_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -98,9 +98,9 @@ async def _revalidate_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 ) @@ -113,7 +113,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace_async async def begin_revalidate( @@ -148,13 +150,13 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -173,7 +175,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: @@ -185,9 +187,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_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def list_by_instance( @@ -210,10 +214,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,12 +240,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -249,13 +253,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceEncryptionProtectorListResult", 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 @@ -268,7 +272,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector" + } @distributed_trace_async async def get( @@ -304,10 +310,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -320,9 +326,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 ) @@ -339,7 +345,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } async def _create_or_update_initial( self, @@ -360,11 +368,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -388,9 +396,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 ) @@ -409,7 +417,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } @overload async def begin_create_or_update( @@ -535,16 +545,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] - 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.ManagedInstanceEncryptionProtector] = 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, managed_instance_name=managed_instance_name, encryption_protector_name=encryption_protector_name, @@ -565,7 +575,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: @@ -577,6 +587,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py index 7fe5218c032f..b54f878f5008 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py @@ -86,10 +86,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKeyListResult] + ) + cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,12 +113,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceKeyListResult", 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 @@ -145,7 +145,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys" + } @distributed_trace_async async def get( @@ -176,10 +178,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] + ) + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,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 ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } async def _create_or_update_initial( self, @@ -232,11 +236,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -260,9 +264,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 ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] - 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.ManagedInstanceKey] = 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, managed_instance_name=managed_instance_name, key_name=key_name, @@ -437,7 +443,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: @@ -449,9 +455,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any @@ -467,10 +475,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -483,9 +491,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 ) @@ -498,7 +506,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @distributed_trace_async async def begin_delete( @@ -528,13 +538,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -553,7 +563,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: @@ -565,6 +575,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py index 28df507bb176..104e75c29024 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py @@ -99,10 +99,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -116,9 +116,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 ) @@ -135,7 +135,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -157,11 +159,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -186,9 +188,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 ) @@ -207,7 +209,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -339,16 +343,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] - 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.ManagedInstanceLongTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -370,7 +374,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: @@ -382,9 +386,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -409,10 +415,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -436,12 +442,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -449,13 +455,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", 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 @@ -468,4 +474,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py index 795617e71240..02cd1d8e1549 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py @@ -82,10 +82,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperationListResult] + ) + cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceOperationListResult", 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 @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations" + } @distributed_trace_async async def get( @@ -171,10 +173,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperation] + ) + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -187,9 +189,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 ) @@ -206,7 +208,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}" + } @distributed_trace_async async def cancel( # pylint: disable=inconsistent-return-statements @@ -237,10 +241,10 @@ async def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -253,9 +257,9 @@ async def cancel( # 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 ) @@ -268,4 +272,6 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py index 01466dfddcd1..03beb7cd5617 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,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 ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,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 ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -320,16 +324,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] - 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.ManagedInstancePrivateEndpointConnection] = 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, managed_instance_name=managed_instance_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -350,7 +354,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: @@ -362,9 +366,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -380,10 +386,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -396,9 +402,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 ) @@ -411,7 +417,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -441,13 +449,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -466,7 +474,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: @@ -478,9 +486,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_managed_instance( @@ -503,10 +513,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -529,12 +539,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -542,13 +552,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", 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 @@ -561,4 +571,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py index 53db792d6004..c9d2405b86d7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py @@ -81,10 +81,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLinkListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -120,13 +120,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstancePrivateLinkListResult", 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 @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLink] + ) + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,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 ) @@ -205,4 +207,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py index 268e6404e0aa..cce3b8fe088c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py @@ -75,11 +75,11 @@ async def _create_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -102,9 +102,9 @@ async def _create_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 ) @@ -117,7 +117,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } @overload async def begin_create( @@ -225,14 +227,14 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -252,7 +254,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: @@ -264,6 +266,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_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py index a3cae18d91fa..b81f57346b44 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py @@ -97,10 +97,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -113,9 +113,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 ) @@ -132,7 +132,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -247,11 +249,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -275,9 +277,9 @@ async def create_or_update( params=_params, ) 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,11 +296,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -335,10 +339,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -351,9 +355,9 @@ async def delete( # 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 ) @@ -366,7 +370,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_instance( @@ -390,10 +396,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -416,12 +422,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -429,13 +435,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", 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 @@ -448,4 +454,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py index c4af3e6a365f..2b9134ef891b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py @@ -90,10 +90,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,12 +117,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -130,13 +130,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -149,7 +149,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.ManagedInstance"]: @@ -165,10 +167,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -190,12 +192,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -203,13 +205,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -222,7 +224,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} @distributed_trace def list_by_resource_group( @@ -243,10 +245,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -269,12 +271,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -282,13 +284,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -301,7 +303,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.Sql/managedInstances"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances" + } @distributed_trace_async async def get( @@ -332,10 +336,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] + ) + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -348,9 +352,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 ) @@ -367,7 +371,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _create_or_update_initial( self, @@ -387,11 +393,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -414,9 +420,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 ) @@ -438,7 +444,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload async def begin_create_or_update( @@ -549,16 +557,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - 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.ManagedInstance] = 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, managed_instance_name=managed_instance_name, parameters=parameters, @@ -578,7 +586,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: @@ -590,9 +598,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -608,10 +618,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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, @@ -623,9 +633,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 ) @@ -638,7 +648,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace_async async def begin_delete( @@ -666,13 +678,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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, @@ -690,7 +702,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: @@ -702,9 +714,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _update_initial( self, @@ -724,11 +738,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -751,9 +765,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 ) @@ -772,7 +786,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload async def begin_update( @@ -883,16 +899,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - 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.ManagedInstance] = 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, managed_instance_name=managed_instance_name, parameters=parameters, @@ -912,7 +928,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: @@ -924,9 +940,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def list_by_managed_instance( @@ -976,10 +994,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopQueriesListResult] + ) + cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1009,12 +1027,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1022,13 +1040,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TopQueriesListResult", 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 @@ -1041,7 +1059,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1061,10 +1081,10 @@ async def _failover_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1077,9 +1097,9 @@ async def _failover_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 ) @@ -1092,7 +1112,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1127,13 +1149,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1152,7 +1174,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: @@ -1164,6 +1186,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 68fbfae1a0fc..1e84dd1eb5f5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,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 ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,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 ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, restorable_dropped_database_id=restorable_dropped_database_id, @@ -371,7 +375,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: @@ -383,9 +387,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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,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 ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, restorable_dropped_database_id=restorable_dropped_database_id, @@ -620,7 +628,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: @@ -632,9 +640,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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_restorable_dropped_database( @@ -659,10 +669,10 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -699,13 +709,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", 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 @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_restorable_dropped_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies"} # type: ignore + list_by_restorable_dropped_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py index 1973278501f4..ad68bc6a244a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py @@ -85,10 +85,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAliasListResult] + ) + cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedServerDnsAliasListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + } @distributed_trace_async async def get( @@ -174,10 +176,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] + ) + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +192,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 ) @@ -209,7 +211,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _create_or_update_initial( self, @@ -230,11 +234,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -258,9 +262,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 ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @overload async def begin_create_or_update( @@ -401,16 +407,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - 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.ManagedServerDnsAlias] = 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, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -431,7 +437,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: @@ -443,9 +449,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any @@ -461,10 +469,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -477,9 +485,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 ) @@ -492,7 +500,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_delete( @@ -522,13 +532,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -547,7 +557,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: @@ -559,9 +569,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _acquire_initial( self, @@ -582,11 +594,11 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -610,9 +622,9 @@ async def _acquire_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 ) @@ -631,7 +643,9 @@ async def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } @overload async def begin_acquire( @@ -750,16 +764,16 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - 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.ManagedServerDnsAlias] = 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._acquire_initial( # type: ignore + raw_result = await self._acquire_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -780,7 +794,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: @@ -792,6 +806,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_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py index 178f89373a98..50f88fe86ee0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,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 ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def begin_create_or_update( @@ -324,16 +328,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] - 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.ManagedServerSecurityAlertPolicy] = 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, managed_instance_name=managed_instance_name, security_alert_policy_name=security_alert_policy_name, @@ -354,7 +358,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: @@ -366,9 +370,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.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_instance( @@ -391,10 +397,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -417,12 +423,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -430,13 +436,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", 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 @@ -449,4 +455,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py index c6170128bbc3..fef56678a74d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py @@ -68,10 +68,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -91,12 +91,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -104,13 +104,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 @@ -123,4 +123,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Sql/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Sql/operations"} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py index 725efcd579b8..30e5a93163a3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] + ) + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,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 ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } async def _create_or_update_initial( self, @@ -149,11 +151,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OutboundFirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,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 ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @overload async def begin_create_or_update( @@ -320,16 +324,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] - 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.OutboundFirewallRule] = 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, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, @@ -350,7 +354,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: @@ -362,9 +366,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -380,10 +386,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -396,9 +402,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 ) @@ -411,7 +417,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace_async async def begin_delete( @@ -441,13 +449,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -466,7 +474,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: @@ -478,9 +486,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def list_by_server( @@ -502,10 +512,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRuleListResult] + ) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -528,12 +538,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -541,13 +551,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OutboundFirewallRuleListResult", 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 @@ -560,4 +570,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py index 2002c62ce3ae..01f56af1af32 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -109,9 +109,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 ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -177,9 +179,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 ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -317,16 +321,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, server_name=server_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -347,7 +351,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: @@ -359,9 +363,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -377,10 +383,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -393,9 +399,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 ) @@ -408,7 +414,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -438,13 +446,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -463,7 +471,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: @@ -475,9 +483,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_server( @@ -500,10 +510,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -526,12 +536,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -539,13 +549,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 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 @@ -558,4 +568,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py index 8d10581d149c..6b30d260e713 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py @@ -76,10 +76,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -115,13 +115,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 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 @@ -134,7 +134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -165,10 +167,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -181,9 +183,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 ) @@ -200,4 +202,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py index 387bcb9e6000..bb79255a7e0c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py @@ -156,11 +156,11 @@ async def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -184,9 +184,9 @@ async def update( # 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 ) @@ -199,4 +199,6 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py index 68ad5e9cc943..7934fcefa532 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py @@ -86,8 +86,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabase] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -100,9 +100,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 ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" + } @distributed_trace def list_by_server( @@ -140,8 +142,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabaseListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -164,12 +166,12 @@ 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: request = HttpRequest("GET", next_link) 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 +179,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RecoverableDatabaseListResult", 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,4 +198,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py index cd6e0a835b63..8a841c14123c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py @@ -78,10 +78,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabaseListResult] + ) + cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RecoverableManagedDatabaseListResult", 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 @@ -136,7 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabase] + ) + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +185,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 ) @@ -202,4 +204,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py index 9a6e75c7eab3..f0f4467cd2ea 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py @@ -87,10 +87,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ReplicationLinkListResult", 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 @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks" + } @distributed_trace_async async def get( @@ -179,10 +181,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] + ) + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,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 ) @@ -215,7 +217,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -231,10 +235,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -248,9 +252,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 ) @@ -263,7 +267,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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } @distributed_trace_async async def begin_delete( @@ -295,13 +301,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -321,7 +327,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: @@ -333,9 +339,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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } async def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -351,10 +359,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -368,9 +376,9 @@ async def _failover_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 ) @@ -389,7 +397,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } @distributed_trace_async async def begin_failover( @@ -422,15 +432,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ReplicationLink] = 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_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -450,7 +460,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: @@ -462,9 +472,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } async def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -480,10 +492,10 @@ async def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -497,9 +509,9 @@ async def _failover_allow_data_loss_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 ) @@ -518,7 +530,9 @@ async def _failover_allow_data_loss_initial( return deserialized - _failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + _failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_failover_allow_data_loss( @@ -551,15 +565,15 @@ async def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ReplicationLink] = 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_allow_data_loss_initial( # type: ignore + raw_result = await self._failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -579,7 +593,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 +605,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_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + begin_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def list_by_server( @@ -614,10 +630,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -640,12 +656,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -653,13 +669,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ReplicationLinkListResult", 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 @@ -672,4 +688,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py index 0fa5588d56cb..b241be3a50aa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py @@ -78,10 +78,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDroppedDatabaseListResult", 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 @@ -136,7 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabase] + ) + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +185,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 ) @@ -202,4 +204,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py index 8c2efc5e0f58..1b1338131e19 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py @@ -81,10 +81,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -120,13 +120,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDroppedManagedDatabaseListResult", 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 @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabase] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,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 ) @@ -205,4 +207,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py index d35a5102233e..1f50ed913d10 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py @@ -85,10 +85,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointListResult] + ) + cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,12 +112,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -125,13 +125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorePointListResult", 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 @@ -144,7 +144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } async def _create_initial( self, @@ -165,11 +167,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RestorePoint]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -193,9 +195,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 ) @@ -217,7 +219,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @overload async def begin_create( @@ -337,16 +341,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] - 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.RestorePoint] = 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, server_name=server_name, database_name=database_name, @@ -367,7 +371,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: @@ -379,9 +383,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.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @distributed_trace_async async def get( @@ -414,10 +420,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] + ) + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -431,9 +437,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 ) @@ -450,7 +456,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -483,10 +491,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -500,9 +508,9 @@ async def delete( # 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 ) @@ -515,4 +523,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py index 29e54151ebc2..3dcaaa3d1cf9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py @@ -101,10 +101,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -131,12 +131,12 @@ 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: request = HttpRequest("GET", next_link) 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("SensitivityLabelListResult", 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 @@ -163,7 +163,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @overload async def update( # pylint: disable=inconsistent-return-statements @@ -266,11 +268,11 @@ async def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -294,9 +296,9 @@ async def update( # 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 ) @@ -309,7 +311,9 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -347,10 +351,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -377,12 +381,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -390,13 +394,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -409,7 +413,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } @distributed_trace_async async def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -457,11 +463,11 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -478,9 +484,9 @@ async def enable_recommendation( # 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 ) @@ -493,7 +499,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace_async async def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -540,11 +548,11 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -561,9 +569,9 @@ async def disable_recommendation( # 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 ) @@ -576,7 +584,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace_async async def get( @@ -624,10 +634,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -644,9 +654,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 ) @@ -663,7 +673,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload async def create_or_update( @@ -803,12 +815,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -836,9 +848,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -855,11 +867,13 @@ async def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -906,11 +920,11 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -927,9 +941,9 @@ async def delete( # 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 ) @@ -942,4 +956,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py index 5e37ae9052a4..a5ae92a999ce 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LogicalServerAdvancedThreatProtectionListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] + ) + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,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 ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,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 ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def begin_create_or_update( @@ -413,16 +419,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] - 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.ServerAdvancedThreatProtection] = 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, server_name=server_name, advanced_threat_protection_name=advanced_threat_protection_name, @@ -443,7 +449,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: @@ -455,6 +461,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py index 9b9ec7e40927..bce34f83de0f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py @@ -88,10 +88,10 @@ async def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( resource_group_name=resource_group_name, @@ -104,9 +104,9 @@ async def list_by_server( params=_params, ) 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 ) @@ -123,7 +123,9 @@ async def list_by_server( return deserialized - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors" + } @distributed_trace_async async def get( @@ -154,10 +156,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -170,9 +172,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 ) @@ -189,7 +191,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } @overload async def update( @@ -293,11 +297,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -321,9 +325,9 @@ async def update( params=_params, ) 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 ) @@ -340,4 +344,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py index a43041fd4405..1cc3909b3f46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py @@ -80,10 +80,10 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -95,9 +95,9 @@ async def get(self, resource_group_name: str, server_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 ) @@ -114,7 +114,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } @overload async def update( @@ -209,11 +211,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -236,9 +238,9 @@ async def update( params=_params, ) 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 ) @@ -255,4 +257,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py index 4c21181e6e28..c123c4083dfe 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] + ) + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,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 ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,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 ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @overload async def begin_create_or_update( @@ -329,16 +333,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] - 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.ServerAzureADAdministrator] = 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, server_name=server_name, administrator_name=administrator_name, @@ -359,7 +363,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: @@ -371,9 +375,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -393,10 +399,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -409,9 +415,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 ) @@ -424,7 +430,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace_async async def begin_delete( @@ -459,13 +467,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -484,7 +492,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: @@ -496,9 +504,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def list_by_server( @@ -521,10 +531,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdministratorListResult] + ) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -547,12 +557,12 @@ 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: request = HttpRequest("GET", next_link) 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 +570,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AdministratorListResult", 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 @@ -579,4 +589,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py index bf39fc4968a3..21d9e1376e45 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,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 ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,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 ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @overload async def begin_create_or_update( @@ -337,16 +341,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] - 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.ServerAzureADOnlyAuthentication] = 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, server_name=server_name, authentication_name=authentication_name, @@ -367,7 +371,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: @@ -379,9 +383,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -401,10 +407,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -417,9 +423,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 ) @@ -432,7 +438,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace_async async def begin_delete( @@ -467,13 +475,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -492,7 +500,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: @@ -504,9 +512,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_server( @@ -529,10 +539,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AzureADOnlyAuthListResult] + ) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +565,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -568,13 +578,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AzureADOnlyAuthListResult", 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 @@ -587,4 +597,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py index c08cd8e2d54d..10d37d5da1e4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerBlobAuditingPolicyListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings" + } @distributed_trace_async async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: @@ -172,11 +174,11 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -189,9 +191,9 @@ async def get(self, resource_group_name: str, server_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 ) @@ -208,7 +210,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } async def _create_or_update_initial( self, @@ -228,12 +232,12 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -257,9 +261,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 ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } @overload async def begin_create_or_update( @@ -398,17 +404,17 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] - 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.ServerBlobAuditingPolicy] = 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, server_name=server_name, parameters=parameters, @@ -429,7 +435,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: @@ -441,6 +447,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py index 8210a13346e7..2f4ed7ad5cf8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py @@ -93,8 +93,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -107,9 +107,9 @@ async def delete( # 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 ) @@ -122,7 +122,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace_async async def get( @@ -153,8 +155,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -167,9 +169,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 ) @@ -186,7 +188,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } async def _create_or_update_initial( self, @@ -207,9 +211,9 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerCommunicationLink]] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -233,9 +237,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 ) @@ -254,7 +258,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @overload async def begin_create_or_update( @@ -374,14 +380,14 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerCommunicationLink] = 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, server_name=server_name, communication_link_name=communication_link_name, @@ -402,7 +408,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: @@ -414,9 +420,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.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def list_by_server( @@ -438,8 +446,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLinkListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -462,12 +470,12 @@ 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: request = HttpRequest("GET", next_link) 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 +483,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerCommunicationLinkListResult", 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 @@ -494,4 +502,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py index 0ac998ec236b..2ef67fabb1d8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] + ) + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerConnectionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,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 ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] - 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.ServerConnectionPolicy] = 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, server_name=server_name, connection_policy_name=connection_policy_name, @@ -351,7 +355,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: @@ -363,9 +367,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.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @distributed_trace def list_by_server( @@ -387,10 +393,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicyListResult] + ) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -413,12 +419,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -426,13 +432,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerConnectionPolicyListResult", 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 @@ -445,4 +451,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py index df1f6b7b7591..f31474761b72 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditSettingsListResult] + ) + cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerDevOpsAuditSettingsListResult", 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 @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings" + } @distributed_trace_async async def get( @@ -177,10 +179,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] + ) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,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 ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } async def _create_or_update_initial( self, @@ -233,11 +237,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -261,9 +265,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 ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } @overload async def begin_create_or_update( @@ -402,16 +408,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] - 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.ServerDevOpsAuditingSettings] = 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, server_name=server_name, dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, @@ -432,10 +438,10 @@ 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": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -447,6 +453,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py index 438805d2d02d..a8af9ea5617c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] + ) + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,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 ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } async def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -145,10 +147,10 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -161,9 +163,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 ) @@ -185,7 +187,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_create_or_update( @@ -216,15 +220,15 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.ServerDnsAlias] = 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, server_name=server_name, dns_alias_name=dns_alias_name, @@ -243,7 +247,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: @@ -255,9 +259,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -273,10 +279,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -289,9 +295,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 ) @@ -304,7 +310,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_delete( @@ -334,13 +342,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -359,7 +367,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: @@ -371,9 +379,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def list_by_server( @@ -394,10 +404,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAliasListResult] + ) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -420,12 +430,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -433,13 +443,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerDnsAliasListResult", 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 @@ -452,7 +462,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases" + } async def _acquire_initial( self, @@ -473,11 +485,11 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -501,9 +513,9 @@ async def _acquire_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 ) @@ -522,7 +534,9 @@ async def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } @overload async def begin_acquire( @@ -641,16 +655,16 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - 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.ServerDnsAlias] = 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._acquire_initial( # type: ignore + raw_result = await self._acquire_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -671,7 +685,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: @@ -683,6 +697,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_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py index 2dc2e8332421..bb3904fc77ac 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py @@ -83,10 +83,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKeyListResult] + ) + cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,12 +109,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -122,13 +122,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerKeyListResult", 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 @@ -141,7 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys" + } @distributed_trace_async async def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: @@ -170,10 +172,10 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] + ) + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,9 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * params=_params, ) 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 ) @@ -205,7 +207,9 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } async def _create_or_update_initial( self, @@ -226,11 +230,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -254,9 +258,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 ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] - 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.ServerKey] = 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, server_name=server_name, key_name=key_name, @@ -437,7 +443,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: @@ -449,9 +455,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any @@ -467,10 +475,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -483,9 +491,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 ) @@ -498,7 +506,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @distributed_trace_async async def begin_delete( @@ -528,13 +538,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -553,7 +563,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: @@ -565,6 +575,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py index b46398e316d0..e8c82072b9a5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py @@ -75,10 +75,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerOperationListResult] + ) + cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -101,12 +101,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -114,13 +114,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerOperationListResult", 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 @@ -133,4 +133,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py index 6748af23d667..a7068dcc9f48 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,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 ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] - 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.ServerSecurityAlertPolicy] = 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, server_name=server_name, security_alert_policy_name=security_alert_policy_name, @@ -351,7 +355,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: @@ -363,9 +367,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.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_server( @@ -388,10 +394,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -414,12 +420,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -427,13 +433,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", 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 @@ -446,4 +452,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py index 6feefb61afe7..9b15295a4f77 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py @@ -85,10 +85,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificatesListResult] + ) + cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustCertificatesListResult", 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 @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates" + } @distributed_trace_async async def get( @@ -174,10 +176,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] + ) + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +192,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 ) @@ -209,7 +211,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } async def _create_or_update_initial( self, @@ -230,11 +234,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustCertificate]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -258,9 +262,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 ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @overload async def begin_create_or_update( @@ -402,16 +408,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] - 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.ServerTrustCertificate] = 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, managed_instance_name=managed_instance_name, certificate_name=certificate_name, @@ -432,7 +438,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: @@ -444,9 +450,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any @@ -462,10 +470,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -478,9 +486,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 ) @@ -493,7 +501,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @distributed_trace_async async def begin_delete( @@ -523,13 +533,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -548,7 +558,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: @@ -560,6 +570,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py index 5c3589cc4a65..81145dc0ed7f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] + ) + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,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 ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } async def _create_or_update_initial( self, @@ -150,11 +152,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -178,9 +180,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 ) @@ -202,7 +204,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @overload async def begin_create_or_update( @@ -322,16 +326,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] - 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.ServerTrustGroup] = 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, location_name=location_name, server_trust_group_name=server_trust_group_name, @@ -352,7 +356,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: @@ -364,9 +368,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -382,10 +388,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -398,9 +404,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 ) @@ -413,7 +419,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace_async async def begin_delete( @@ -443,13 +451,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -468,7 +476,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: @@ -480,9 +488,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def list_by_location( @@ -503,10 +513,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -529,12 +539,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -542,13 +552,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustGroupListResult", 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 @@ -561,7 +571,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups" + } @distributed_trace def list_by_instance( @@ -582,10 +594,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -608,12 +620,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -621,13 +633,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustGroupListResult", 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 @@ -640,4 +652,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py index a2266c57b9f3..c33c74a74d92 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py @@ -75,8 +75,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerUsageListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -99,12 +99,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -112,13 +112,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerUsageListResult", 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 @@ -131,4 +131,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py index 8fb133825cc9..8b9189ff450c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py @@ -97,10 +97,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -113,9 +113,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 ) @@ -132,7 +132,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -247,11 +249,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -275,9 +277,9 @@ async def create_or_update( params=_params, ) 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,11 +296,13 @@ async def create_or_update( deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -335,10 +339,10 @@ async def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -351,9 +355,9 @@ async def delete( # 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 ) @@ -366,7 +370,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_server( @@ -389,10 +395,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -415,12 +421,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -428,13 +434,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", 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 @@ -447,4 +453,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py index abb1ee3d3760..017ae2ebb3a8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py @@ -87,10 +87,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,12 +113,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerListResult", 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 @@ -145,7 +145,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.Sql/servers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + } @distributed_trace_async async def get( @@ -176,10 +178,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] + ) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,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 ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO], **kwargs: Any @@ -227,11 +231,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -254,9 +258,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 ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload async def begin_create_or_update( @@ -385,16 +391,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - 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.Server] = 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, server_name=server_name, parameters=parameters, @@ -414,7 +420,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: @@ -426,9 +432,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.Sql/servers/{serverName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any @@ -444,10 +452,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -459,9 +467,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 ) @@ -474,7 +482,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.Sql/servers/{serverName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -500,13 +510,13 @@ async def begin_delete(self, resource_group_name: str, server_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -524,7 +534,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: @@ -536,9 +546,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.Sql/servers/{serverName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.ServerUpdate, IO], **kwargs: Any @@ -554,11 +566,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -581,9 +593,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 ) @@ -602,7 +614,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload async def begin_update( @@ -709,16 +723,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - 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.Server] = 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, server_name=server_name, parameters=parameters, @@ -738,7 +752,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: @@ -750,9 +764,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.Sql/servers/{serverName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Server"]: @@ -768,10 +784,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -793,12 +809,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -806,13 +822,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServerListResult", 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 @@ -825,7 +841,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} async def _import_database_initial( self, @@ -845,11 +861,11 @@ async def _import_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -872,9 +888,9 @@ async def _import_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 ) @@ -893,7 +909,9 @@ async def _import_database_initial( return deserialized - _import_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + _import_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload async def begin_import_database( @@ -1004,16 +1022,16 @@ async def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - 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.ImportExportOperationResult] = 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._import_database_initial( # type: ignore + raw_result = await self._import_database_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -1033,7 +1051,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: @@ -1045,9 +1063,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_import_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + begin_import_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload async def check_name_availability( @@ -1111,11 +1131,11 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1136,9 +1156,9 @@ async def check_name_availability( params=_params, ) 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 ) @@ -1155,4 +1175,6 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability"} # type: ignore + check_name_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py index 9198deb104ef..17841b39b4b9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py @@ -86,8 +86,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjective] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -100,9 +100,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 ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" + } @distributed_trace def list_by_server( @@ -140,8 +142,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjectiveListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -164,12 +166,12 @@ 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: request = HttpRequest("GET", next_link) 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 +179,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceObjectiveListResult", 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,4 +198,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py index 68827ecc256c..2069ecac3e81 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py @@ -82,10 +82,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -97,9 +97,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 ) @@ -116,7 +116,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } @overload async def create_or_update( @@ -210,11 +212,11 @@ async def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -237,9 +239,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -256,4 +258,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py index 3da48cc28d89..78ceafb8b658 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py @@ -91,13 +91,13 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,12 +122,12 @@ 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: request = HttpRequest("GET", next_link) 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): ) 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 @@ -156,7 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace_async async def get( @@ -198,13 +200,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -219,9 +221,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 ) @@ -238,4 +240,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py index 549585ee8305..0bb34bfef106 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py @@ -180,14 +180,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -213,9 +213,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -232,4 +232,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py index 5d29196ac34a..b23cae70124b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py @@ -75,13 +75,13 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -95,9 +95,9 @@ async def _execute_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 ) @@ -110,7 +110,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace_async async def begin_execute( @@ -148,16 +150,16 @@ async def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -177,7 +179,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: @@ -189,6 +191,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_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py index 5c9f8172f5d5..a55a03ba8d57 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py @@ -95,13 +95,13 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -127,12 +127,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -142,13 +142,13 @@ async def extract_data(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 @@ -161,7 +161,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace_async async def get( @@ -206,13 +208,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -228,9 +230,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 ) @@ -247,7 +249,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload async def create_or_update( @@ -382,14 +386,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -416,9 +420,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -435,4 +439,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py index 97fd4ab6c493..7eaaa39099d2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py @@ -98,13 +98,13 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -120,9 +120,9 @@ async def delete( # 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 ) @@ -135,4 +135,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py index 0830ba0da739..10b203067a05 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py @@ -96,13 +96,13 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,12 +128,12 @@ 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: request = HttpRequest("GET", next_link) 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("SQLVulnerabilityAssessmentScanListResult", 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 @@ -160,7 +160,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace_async async def get( @@ -207,13 +209,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -229,9 +231,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 ) @@ -248,4 +250,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py index 581adb04c3e1..4c55f5647006 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py @@ -91,13 +91,13 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,12 +122,12 @@ 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: request = HttpRequest("GET", next_link) 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("SqlVulnerabilityAssessmentScanRecordListResult", 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 @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -196,13 +198,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -217,9 +219,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 ) @@ -236,4 +238,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py index 14396137fd64..e27662dc48f5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py @@ -89,10 +89,10 @@ async def delete( # 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -105,9 +105,9 @@ async def delete( # 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 ) @@ -120,4 +120,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py index 2789bff969d9..5e55adb6c080 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py @@ -82,10 +82,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", 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 @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + } @distributed_trace_async async def get( @@ -177,10 +179,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,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 ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -318,11 +322,11 @@ async def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -346,9 +350,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -365,8 +369,10 @@ async def create_or_update( deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py index 92dc786ea800..55416cea7820 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py @@ -71,10 +71,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsageListResult] + ) + cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -96,12 +96,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -109,13 +109,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SubscriptionUsageListResult", 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 @@ -128,7 +128,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" + } @distributed_trace_async async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: @@ -154,10 +156,10 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsage] + ) + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -169,9 +171,9 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode params=_params, ) 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 ) @@ -188,4 +190,6 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py index 5faaef57452f..78d6c122131f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py @@ -78,10 +78,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SynapseLinkWorkspaceListResult] + ) + cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -105,12 +105,12 @@ 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: request = HttpRequest("GET", next_link) 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("SynapseLinkWorkspaceListResult", 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 @@ -137,4 +137,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py index a7a2ca0fe5fc..33e34f578688 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] + ) + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,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 ) @@ -130,7 +130,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } async def _create_or_update_initial( self, @@ -151,11 +153,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -179,9 +181,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 ) @@ -203,7 +205,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @overload async def begin_create_or_update( @@ -323,16 +327,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] - 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.SyncAgent] = 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, server_name=server_name, sync_agent_name=sync_agent_name, @@ -353,7 +357,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: @@ -365,9 +369,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -383,10 +389,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -399,9 +405,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 ) @@ -414,7 +420,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace_async async def begin_delete( @@ -444,13 +452,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -469,7 +477,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: @@ -481,9 +489,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def list_by_server( @@ -504,10 +514,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentListResult] + ) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -530,12 +540,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -543,13 +553,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncAgentListResult", 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 @@ -562,7 +572,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents" + } @distributed_trace_async async def generate_key( @@ -593,10 +605,10 @@ async def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentKeyProperties] + ) + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( resource_group_name=resource_group_name, @@ -609,9 +621,9 @@ async def generate_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 ) @@ -628,7 +640,9 @@ async def generate_key( return deserialized - generate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey"} # type: ignore + generate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey" + } @distributed_trace def list_linked_databases( @@ -652,10 +666,10 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentLinkedDatabaseListResult] + ) + cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -679,12 +693,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -692,13 +706,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncAgentLinkedDatabaseListResult", 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 @@ -711,4 +725,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_linked_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases"} # type: ignore + list_linked_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py index b09f6b2a6e19..1e7d07fd311b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py @@ -89,10 +89,10 @@ def list_sync_database_ids( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncDatabaseIdListResult] + ) + cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncDatabaseIdListResult", 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 @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sync_database_ids.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds"} # type: ignore + list_sync_database_ids.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" + } async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -162,10 +164,10 @@ async def _refresh_hub_schema_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( resource_group_name=resource_group_name, @@ -179,9 +181,9 @@ async def _refresh_hub_schema_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 ) @@ -194,7 +196,9 @@ async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _refresh_hub_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + _refresh_hub_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace_async async def begin_refresh_hub_schema( @@ -226,13 +230,13 @@ async def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._refresh_hub_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -252,7 +256,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: @@ -264,9 +268,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_refresh_hub_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + begin_refresh_hub_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def list_hub_schemas( @@ -293,10 +299,10 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -321,12 +327,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -334,13 +340,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", 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 @@ -353,7 +359,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_hub_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas"} # type: ignore + list_hub_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas" + } @distributed_trace def list_logs( @@ -398,10 +406,10 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupLogListResult] + ) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -430,12 +438,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -443,13 +451,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncGroupLogListResult", 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 @@ -462,7 +470,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs"} # type: ignore + list_logs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs" + } @distributed_trace_async async def cancel_sync( # pylint: disable=inconsistent-return-statements @@ -495,10 +505,10 @@ async def cancel_sync( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( resource_group_name=resource_group_name, @@ -512,9 +522,9 @@ async def cancel_sync( # 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 ) @@ -527,7 +537,9 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync"} # type: ignore + cancel_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync" + } @distributed_trace_async async def trigger_sync( # pylint: disable=inconsistent-return-statements @@ -560,10 +572,10 @@ async def trigger_sync( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( resource_group_name=resource_group_name, @@ -577,9 +589,9 @@ async def trigger_sync( # 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 ) @@ -592,7 +604,9 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - trigger_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync"} # type: ignore + trigger_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync" + } @distributed_trace_async async def get( @@ -625,10 +639,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] + ) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -642,9 +656,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 ) @@ -661,7 +675,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _create_or_update_initial( self, @@ -683,11 +699,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -712,9 +728,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 ) @@ -736,7 +752,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload async def begin_create_or_update( @@ -865,16 +883,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - 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.SyncGroup] = 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, server_name=server_name, database_name=database_name, @@ -896,7 +914,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: @@ -908,9 +926,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -926,10 +946,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -943,9 +963,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 ) @@ -958,7 +978,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace_async async def begin_delete( @@ -990,13 +1012,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -1016,7 +1038,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: @@ -1028,9 +1050,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _update_initial( self, @@ -1052,11 +1076,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1081,9 +1105,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 ) @@ -1102,7 +1126,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload async def begin_update( @@ -1231,16 +1257,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - 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.SyncGroup] = 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, server_name=server_name, database_name=database_name, @@ -1262,7 +1288,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: @@ -1274,9 +1300,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def list_by_database( @@ -1299,10 +1327,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupListResult] + ) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1326,12 +1354,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1339,13 +1367,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncGroupListResult", 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 @@ -1358,4 +1386,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py index f7bc5afa4a41..81bf04aa8585 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py @@ -107,10 +107,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] + ) + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -125,9 +125,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 ) @@ -144,7 +144,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _create_or_update_initial( self, @@ -167,11 +169,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -197,9 +199,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 ) @@ -221,7 +223,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload async def begin_create_or_update( @@ -362,16 +366,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - 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.SyncMember] = 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, server_name=server_name, database_name=database_name, @@ -394,7 +398,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: @@ -406,9 +410,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,10 +436,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -448,9 +454,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 ) @@ -463,7 +469,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace_async async def begin_delete( @@ -504,13 +512,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -531,7 +539,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: @@ -543,9 +551,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _update_initial( self, @@ -568,11 +578,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -598,9 +608,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 ) @@ -619,7 +629,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload async def begin_update( @@ -760,16 +772,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - 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.SyncMember] = 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, server_name=server_name, database_name=database_name, @@ -792,7 +804,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: @@ -804,9 +816,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def list_by_sync_group( @@ -831,10 +845,10 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMemberListResult] + ) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -859,12 +873,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -872,13 +886,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncMemberListResult", 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 @@ -891,7 +905,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sync_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers"} # type: ignore + list_by_sync_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers" + } @distributed_trace def list_member_schemas( @@ -927,10 +943,10 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -956,12 +972,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -969,13 +985,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", 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 @@ -988,7 +1004,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_member_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas"} # type: ignore + list_member_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas" + } async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-statements self, @@ -1010,10 +1028,10 @@ async def _refresh_member_schema_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( resource_group_name=resource_group_name, @@ -1028,9 +1046,9 @@ async def _refresh_member_schema_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 ) @@ -1043,7 +1061,9 @@ async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _refresh_member_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + _refresh_member_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } @distributed_trace_async async def begin_refresh_member_schema( @@ -1084,13 +1104,13 @@ async def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._refresh_member_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -1111,7 +1131,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: @@ -1123,6 +1143,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_refresh_member_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + begin_refresh_member_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py index 9984ae142314..5950ddbaad09 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py @@ -71,11 +71,11 @@ async def _create_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -98,9 +98,9 @@ async def _create_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 ) @@ -113,7 +113,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } @overload async def begin_create( @@ -217,14 +219,14 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -244,7 +246,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: @@ -256,6 +258,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_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py index 8bde9cbbe83d..385dac81007b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py @@ -71,10 +71,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZoneListResult] + ) + cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -96,12 +96,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -109,13 +109,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TimeZoneListResult", 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 @@ -128,7 +128,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" + } @distributed_trace_async async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: @@ -154,10 +156,10 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZone] + ) + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -169,9 +171,9 @@ async def get(self, location_name: str, time_zone_id: 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 = 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 ) @@ -188,4 +190,6 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py index db0fc255b7b8..6d12c29fb4c3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryption] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,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 ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) 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 ) @@ -303,7 +305,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -329,10 +333,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -356,12 +360,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -369,13 +373,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryptionListResult", 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 @@ -388,4 +392,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py index e50d4ffd6bc8..665cfb7aa068 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py @@ -78,10 +78,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult] + ) + cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -105,12 +105,12 @@ 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: request = HttpRequest("GET", next_link) 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("UsageListResult", 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 @@ -137,4 +137,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py index db6ae7a4c8ca..322ed6a33f48 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py @@ -78,10 +78,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -115,13 +115,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("VirtualClusterListResult", 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 @@ -134,7 +134,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} @distributed_trace def list_by_resource_group( @@ -153,10 +153,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -178,12 +178,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("VirtualClusterListResult", 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 @@ -210,7 +210,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.Sql/virtualClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters" + } @distributed_trace_async async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: @@ -237,10 +239,10 @@ async def get(self, resource_group_name: str, virtual_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] + ) + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -252,9 +254,9 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg params=_params, ) 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 ) @@ -271,7 +273,9 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -287,10 +291,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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, @@ -302,9 +306,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 ) @@ -317,7 +321,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @distributed_trace_async async def begin_delete( @@ -345,13 +351,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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, @@ -369,7 +375,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: @@ -381,9 +387,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _update_initial( self, @@ -403,11 +411,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualCluster]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -430,9 +438,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 ) @@ -451,7 +459,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @overload async def begin_update( @@ -562,16 +572,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] - 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.VirtualCluster] = 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, virtual_cluster_name=virtual_cluster_name, parameters=parameters, @@ -591,7 +601,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: @@ -603,9 +613,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -621,10 +633,10 @@ async def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] + ) + cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( resource_group_name=resource_group_name, @@ -636,9 +648,9 @@ async def _update_dns_servers_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 ) @@ -657,7 +669,9 @@ async def _update_dns_servers_initial( return deserialized - _update_dns_servers_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + _update_dns_servers_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } @distributed_trace_async async def begin_update_dns_servers( @@ -688,15 +702,15 @@ async def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateVirtualClusterDnsServersOperation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( # type: ignore + raw_result = await self._update_dns_servers_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, api_version=api_version, @@ -714,7 +728,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: @@ -726,6 +740,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_dns_servers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + begin_update_dns_servers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py index 149c75a2a50d..932007621a74 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] + ) + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,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 ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualNetworkRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,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 ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] - 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.VirtualNetworkRule] = 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, server_name=server_name, virtual_network_rule_name=virtual_network_rule_name, @@ -351,7 +355,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: @@ -363,9 +367,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -381,10 +387,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -397,9 +403,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 ) @@ -412,7 +418,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace_async async def begin_delete( @@ -442,13 +450,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -467,7 +475,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: @@ -479,9 +487,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def list_by_server( @@ -502,10 +512,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRuleListResult] + ) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -528,12 +538,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -541,13 +551,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("VirtualNetworkRuleListResult", 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 @@ -560,4 +570,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py index 3e66b73de037..356d2366dc48 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py @@ -104,10 +104,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] + ) + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -122,9 +122,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 ) @@ -141,7 +141,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } async def _create_or_update_initial( self, @@ -164,11 +166,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadClassifier]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -194,9 +196,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 ) @@ -218,7 +220,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @overload async def begin_create_or_update( @@ -362,16 +366,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] - 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.WorkloadClassifier] = 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, server_name=server_name, database_name=database_name, @@ -394,7 +398,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: @@ -406,9 +410,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,10 +436,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -448,9 +454,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 ) @@ -463,7 +469,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace_async async def begin_delete( @@ -504,13 +512,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -531,7 +539,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: @@ -543,9 +551,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def list_by_workload_group( @@ -571,10 +581,10 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifierListResult] + ) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -599,12 +609,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -612,13 +622,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("WorkloadClassifierListResult", 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 @@ -631,4 +641,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_workload_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers"} # type: ignore + list_by_workload_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py index ac3e15e4dd45..a41f1f694d4a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] + ) + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,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 ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } async def _create_or_update_initial( self, @@ -153,11 +155,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,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 ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @overload async def begin_create_or_update( @@ -335,16 +339,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] - 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.WorkloadGroup] = 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, server_name=server_name, database_name=database_name, @@ -366,7 +370,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: @@ -378,9 +382,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -396,10 +402,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -413,9 +419,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 ) @@ -428,7 +434,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace_async async def begin_delete( @@ -460,13 +468,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -486,7 +494,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: @@ -498,9 +506,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def list_by_database( @@ -523,10 +533,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroupListResult] + ) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -550,12 +560,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -563,13 +573,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("WorkloadGroupListResult", 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 @@ -582,4 +592,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 097acf993df3..db441b90db83 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -405,6 +405,7 @@ from ._sql_management_client_enums import AdvancedThreatProtectionState from ._sql_management_client_enums import AdvisorStatus from ._sql_management_client_enums import AggregationFunctionType +from ._sql_management_client_enums import AlwaysEncryptedEnclaveType from ._sql_management_client_enums import AuthenticationName from ._sql_management_client_enums import AutoExecuteStatus from ._sql_management_client_enums import AutoExecuteStatusInheritedFrom @@ -545,7 +546,7 @@ from ._sql_management_client_enums import VulnerabilityAssessmentScanState from ._sql_management_client_enums import VulnerabilityAssessmentScanTriggerType 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__ = [ @@ -947,6 +948,7 @@ "AdvancedThreatProtectionState", "AdvisorStatus", "AggregationFunctionType", + "AlwaysEncryptedEnclaveType", "AuthenticationName", "AutoExecuteStatus", "AutoExecuteStatusInheritedFrom", diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index d0d0e0776df5..ff66772cd7b1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -963,6 +963,9 @@ class Database(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype is_infra_encryption_enabled: bool :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. :vartype federated_client_id: str + :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType :ivar source_resource_id: The resource identifier of the source associated with the create operation of this database. @@ -1063,6 +1066,7 @@ class Database(TrackedResource): # pylint: disable=too-many-instance-attributes "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, "is_infra_encryption_enabled": {"key": "properties.isInfraEncryptionEnabled", "type": "bool"}, "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, + "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, } @@ -1097,6 +1101,7 @@ def __init__( # pylint: disable=too-many-locals maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, federated_client_id: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, source_resource_id: Optional[str] = None, **kwargs ): @@ -1226,6 +1231,9 @@ def __init__( # pylint: disable=too-many-locals :paramtype is_ledger_on: bool :keyword federated_client_id: The Client id used for cross tenant per database CMK scenario. :paramtype federated_client_id: str + :keyword preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType :keyword source_resource_id: The resource identifier of the source associated with the create operation of this database. @@ -1294,6 +1302,7 @@ def __init__( # pylint: disable=too-many-locals self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None self.federated_client_id = federated_client_id + self.preferred_enclave_type = preferred_enclave_type self.source_resource_id = source_resource_id @@ -2810,6 +2819,9 @@ class DatabaseUpdate(_serialization.Model): # pylint: disable=too-many-instance :vartype is_infra_encryption_enabled: bool :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. :vartype federated_client_id: str + :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType """ _validation = { @@ -2874,6 +2886,7 @@ class DatabaseUpdate(_serialization.Model): # pylint: disable=too-many-instance "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, "is_infra_encryption_enabled": {"key": "properties.isInfraEncryptionEnabled", "type": "bool"}, "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, + "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -2906,6 +2919,7 @@ def __init__( # pylint: disable=too-many-locals maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, federated_client_id: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, **kwargs ): """ @@ -3017,6 +3031,9 @@ def __init__( # pylint: disable=too-many-locals :paramtype is_ledger_on: bool :keyword federated_client_id: The Client id used for cross tenant per database CMK scenario. :paramtype federated_client_id: str + :keyword preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType """ super().__init__(**kwargs) self.sku = sku @@ -3060,6 +3077,7 @@ def __init__( # pylint: disable=too-many-locals self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None self.federated_client_id = federated_client_id + self.preferred_enclave_type = preferred_enclave_type class DatabaseUsage(ProxyResource): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index 7c254026bc8e..1807954ca421 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py @@ -59,6 +59,13 @@ class AggregationFunctionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUM = "sum" +class AlwaysEncryptedEnclaveType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of enclave requested on the database i.e. Default or VBS enclaves.""" + + DEFAULT = "Default" + VBS = "VBS" + + class AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AuthenticationName.""" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index f6785e094a7f..6f4b420e6fd9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -183,7 +183,7 @@ from ._virtual_clusters_operations import VirtualClustersOperations 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/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py index fb07e792c840..8d987ea3500a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py @@ -53,9 +53,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -136,10 +136,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -155,7 +155,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -174,9 +174,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -257,10 +257,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +274,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 ) @@ -293,7 +293,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -315,11 +317,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -344,9 +346,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 ) @@ -365,7 +367,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -494,16 +498,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - 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.BackupShortTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -525,7 +529,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: @@ -537,9 +541,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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -561,11 +567,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -590,9 +596,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 ) @@ -611,7 +617,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -740,16 +748,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - 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.BackupShortTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -771,7 +779,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: @@ -783,9 +791,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.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -809,10 +819,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -836,12 +846,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -849,13 +859,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", 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 @@ -868,4 +878,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py index 153081c68be9..b88f3ea65b95 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py @@ -49,9 +49,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if include is not None: @@ -124,10 +124,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationCapabilities] + ) + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( location_name=location_name, @@ -139,9 +139,9 @@ def list_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 ) @@ -158,4 +158,6 @@ def list_by_location( return deserialized - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py index 4d2a20a7ea1f..9ff8c50cfbac 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py @@ -45,9 +45,9 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_create_or_update_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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") @@ -82,8 +82,8 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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") @@ -243,10 +243,10 @@ def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -271,9 +271,9 @@ def create_or_update( params=_params, ) 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 ) @@ -290,7 +290,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } @distributed_trace def get( @@ -325,9 +327,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -341,9 +343,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 ) @@ -360,4 +362,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py index 271c963a780d..ca7d113e7f79 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py @@ -51,9 +51,9 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_create_or_update_request( "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_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") @@ -89,8 +89,8 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_list_by_database_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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,10 +261,10 @@ def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRule] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +290,9 @@ def create_or_update( params=_params, ) 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 ) @@ -309,11 +309,13 @@ def create_or_update( deserialized = self._deserialize("DataMaskingRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" + } @distributed_trace def list_by_database( @@ -340,9 +342,9 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRuleListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -367,12 +369,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -380,13 +382,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DataMaskingRuleListResult", 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 @@ -399,4 +401,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py index 378809bfb9f1..a0af9e932ddb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -88,9 +88,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -173,10 +173,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivities] + ) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +190,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 ) @@ -209,7 +209,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}" + } @distributed_trace def list_by_database( @@ -233,10 +235,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivitiesListResult] + ) + cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,12 +262,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -273,13 +275,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DataWarehouseUserActivitiesListResult", 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 @@ -292,4 +294,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py index bd02add06336..50f456a9f69b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py @@ -46,9 +46,9 @@ def build_list_by_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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -127,10 +127,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -148,7 +148,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -202,10 +202,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +229,12 @@ 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: request = HttpRequest("GET", next_link) 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("DatabaseAdvancedThreatProtectionListResult", 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 @@ -261,7 +261,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -301,10 +303,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -318,9 +320,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 ) @@ -337,7 +339,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def create_or_update( @@ -456,11 +460,11 @@ def 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -485,9 +489,9 @@ def create_or_update( params=_params, ) 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,8 +508,10 @@ def create_or_update( deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py index f855eb46d8dc..75e9b3eb2b53 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py @@ -51,9 +51,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -92,9 +92,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -132,10 +132,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -151,7 +151,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -219,10 +219,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( resource_group_name=resource_group_name, @@ -236,9 +236,9 @@ def list_by_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 ) @@ -255,7 +255,9 @@ def list_by_database( return deserialized - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors" + } @distributed_trace def get( @@ -288,10 +290,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -305,9 +307,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 ) @@ -324,7 +326,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } @overload def update( @@ -437,11 +441,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -466,9 +470,9 @@ def update( params=_params, ) 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 ) @@ -485,4 +489,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py index 5f79cdb8a612..7426d1aeb267 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py @@ -45,9 +45,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,10 +79,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -97,7 +97,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -158,10 +158,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -174,9 +174,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 ) @@ -193,7 +193,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } @overload def update( @@ -297,11 +299,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -325,9 +327,9 @@ def update( params=_params, ) 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 ) @@ -344,4 +346,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py index 6d6b47e1caa4..21268097feb5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py @@ -46,9 +46,9 @@ def build_list_by_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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,10 +80,10 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -116,11 +116,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -136,7 +136,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -190,10 +190,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -230,13 +230,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseBlobAuditingPolicyListResult", 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 @@ -249,7 +249,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings" + } @distributed_trace def get( @@ -283,11 +285,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -301,9 +303,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 ) @@ -320,7 +322,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } @overload def create_or_update( @@ -433,12 +437,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -463,9 +467,9 @@ def create_or_update( params=_params, ) 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 ) @@ -482,8 +486,10 @@ def create_or_update( deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py index 90a4ff406b78..3dd9fc8699ab 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py @@ -56,9 +56,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if schema is not None: @@ -108,9 +108,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_list_by_table_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -153,9 +153,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -244,10 +244,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -289,13 +289,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -345,10 +347,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -375,12 +377,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -388,13 +390,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -407,7 +409,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace def get( @@ -451,10 +455,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -470,9 +474,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 ) @@ -489,4 +493,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py index 4cfe2ec4e89e..a6995987fa5c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py @@ -52,9 +52,9 @@ def build_get_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -87,10 +87,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,9 +125,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +142,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -203,10 +203,10 @@ def get( # 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -220,9 +220,9 @@ def get( # 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 ) @@ -235,7 +235,9 @@ def get( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } def _create_or_update_initial( self, @@ -257,11 +259,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -286,9 +288,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 ) @@ -307,7 +309,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @overload def begin_create_or_update( @@ -439,16 +443,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationResult] - 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.ImportExportExtensionsOperationResult] = 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, server_name=server_name, database_name=database_name, @@ -470,7 +474,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: @@ -482,9 +486,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.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @distributed_trace def list_by_database( @@ -509,10 +515,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationListResult] + ) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -536,12 +542,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -549,13 +555,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ImportExportExtensionsOperationListResult", 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 @@ -568,4 +574,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py index db676e7aaef9..7cc49f972663 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py @@ -50,9 +50,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,9 +80,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -158,10 +158,10 @@ def cancel( # 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -175,9 +175,9 @@ def cancel( # 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 ) @@ -190,7 +190,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_database( @@ -213,10 +215,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseOperationListResult] + ) + cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -240,12 +242,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -253,13 +255,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseOperationListResult", 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 @@ -272,4 +274,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py index cb73d67abc6e..54f4d3bcb8c5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py @@ -50,9 +50,9 @@ def build_list_by_database_advisor_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_database_advisor_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,9 +91,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -133,10 +133,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -153,7 +153,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -216,10 +216,10 @@ def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.RecommendedAction]] + ) + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -233,9 +233,9 @@ def list_by_database_advisor( params=_params, ) 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,7 +252,9 @@ def list_by_database_advisor( return deserialized - list_by_database_advisor.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions"} # type: ignore + list_by_database_advisor.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -311,9 +313,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 ) @@ -330,7 +332,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } @overload def update( @@ -452,11 +456,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -482,9 +486,9 @@ def update( params=_params, ) 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 ) @@ -501,4 +505,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py index 32000519e870..91cd0120cd19 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py @@ -52,9 +52,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -93,9 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -170,10 +170,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +198,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -211,13 +211,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSchemaListResult", 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 @@ -230,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -280,9 +282,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 ) @@ -299,4 +301,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py index 0442feadc297..a2c944af9b17 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,10 +91,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -129,9 +129,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,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 ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) 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 ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertListResult] + ) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -482,13 +486,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSecurityAlertListResult", 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 @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py index 3063eb15f68a..94aaf2799d03 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py @@ -51,9 +51,9 @@ def build_list_by_sql_vulnerability_assessment_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_sql_vulnerability_assessment_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -94,9 +94,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -138,10 +138,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -160,7 +160,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -223,10 +223,10 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -251,12 +251,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -266,13 +266,13 @@ def extract_data(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 @@ -285,7 +285,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace def get( @@ -327,10 +329,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -345,9 +347,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 ) @@ -364,7 +366,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } @overload def create_or_update( @@ -491,11 +495,11 @@ def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -521,9 +525,9 @@ def create_or_update( params=_params, ) 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 ) @@ -540,4 +544,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py index b306ed90b0c8..4721501eb620 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -51,9 +51,9 @@ def build_execute_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -69,7 +69,7 @@ def build_execute_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 _execute_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -132,9 +132,9 @@ def _execute_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 ) @@ -147,7 +147,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace def begin_execute( @@ -185,13 +187,13 @@ def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -211,7 +213,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: @@ -223,6 +225,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_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py index a4dde10cb84d..4e0dca1ad673 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -52,9 +52,9 @@ def build_list_by_baseline_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_baseline_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -97,9 +97,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -166,7 +166,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -191,9 +191,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -211,7 +211,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -272,10 +272,10 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -301,12 +301,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -316,13 +316,13 @@ def extract_data(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 @@ -335,7 +335,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace def get( @@ -380,10 +382,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -399,9 +401,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 ) @@ -418,7 +420,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload def create_or_update( @@ -553,11 +557,11 @@ def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -584,9 +588,9 @@ def create_or_update( params=_params, ) 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 ) @@ -603,7 +607,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -648,10 +654,10 @@ def delete( # 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -667,9 +673,9 @@ def delete( # 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 ) @@ -682,4 +688,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py index 2355714b5b00..ca71ecc4a643 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -52,9 +52,9 @@ def build_list_by_scan_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -97,9 +97,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -185,10 +185,10 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -214,12 +214,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -227,13 +227,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", 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 @@ -246,7 +246,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -312,9 +314,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 ) @@ -331,4 +333,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py index f95db93119a3..f66acfc1fd9d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -51,9 +51,9 @@ def build_list_by_sql_vulnerability_assessments_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_sql_vulnerability_assessments_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -94,9 +94,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -176,10 +176,10 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -204,12 +204,12 @@ 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: request = HttpRequest("GET", next_link) 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("SqlVulnerabilityAssessmentScanRecordListResult", 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 @@ -236,7 +236,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -278,10 +280,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -296,9 +298,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 ) @@ -315,4 +317,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py index 171a084ba1a1..15eeea8e771a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -46,9 +46,9 @@ def build_list_by_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -157,10 +157,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -184,12 +184,12 @@ 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: request = HttpRequest("GET", next_link) 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("SqlVulnerabilityAssessmentListResult", 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 @@ -216,7 +216,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + } @distributed_trace def get( @@ -256,10 +258,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -273,9 +275,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 ) @@ -292,4 +294,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py index d35b3cb4f141..c33ab90d591d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py @@ -53,9 +53,9 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -96,9 +96,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -177,10 +177,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +206,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -219,13 +219,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseTableListResult", 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 @@ -238,7 +238,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace def get( @@ -279,10 +281,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,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 ) @@ -316,4 +318,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py index b0165fa5902f..2c97bfd00618 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py @@ -46,9 +46,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -114,10 +114,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseUsageListResult] + ) + cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,12 +141,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -154,13 +154,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseUsageListResult", 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 @@ -173,4 +173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py index 116c152a5ce1..3f0deded38ff 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -98,10 +98,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -121,7 +121,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -146,9 +146,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -258,9 +258,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 ) @@ -277,7 +277,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload def create_or_update( @@ -420,11 +422,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -451,9 +453,9 @@ def create_or_update( params=_params, ) 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 ) @@ -470,7 +472,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -518,10 +522,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -537,9 +541,9 @@ def delete( # 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 ) @@ -552,4 +556,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py index 5e9bac0c40b3..d2c23a77b280 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py @@ -53,9 +53,9 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_initiate_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,9 +91,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +134,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -178,9 +178,9 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -249,10 +249,10 @@ def _initiate_scan_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -267,9 +267,9 @@ def _initiate_scan_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 ) @@ -282,7 +282,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def begin_initiate_scan( @@ -323,13 +325,13 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -350,7 +352,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: @@ -362,9 +364,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_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def list_by_database( @@ -396,10 +400,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -424,12 +428,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -437,13 +441,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", 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 @@ -456,7 +460,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -498,10 +504,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -516,9 +522,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 ) @@ -535,7 +541,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } @distributed_trace def export( @@ -577,10 +585,10 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -595,9 +603,9 @@ def export( params=_params, ) 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 ) @@ -614,8 +622,10 @@ def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py index 068972528632..bfb80bd0f206 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -114,7 +114,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -137,9 +137,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -155,7 +155,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -169,9 +169,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +186,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,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 ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -408,11 +410,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -437,9 +439,9 @@ def create_or_update( params=_params, ) 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 ) @@ -456,11 +458,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -500,10 +504,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -517,9 +521,9 @@ def delete( # 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 ) @@ -532,7 +536,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -557,10 +563,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -584,12 +590,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -597,13 +603,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", 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 @@ -616,4 +622,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py index 27bffd6073ba..337c5aac4e48 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py @@ -48,7 +48,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_metrics_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") @@ -81,7 +81,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_metric_definitions_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") @@ -113,9 +113,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -148,9 +148,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +165,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -182,10 +182,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -218,9 +218,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -233,7 +233,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -247,10 +247,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +265,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -284,10 +284,10 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -302,7 +302,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -326,9 +326,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -341,7 +341,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if replica_type is not None: @@ -357,10 +357,10 @@ def build_import_method_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -375,7 +375,7 @@ def build_import_method_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -394,10 +394,10 @@ def build_rename_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -410,7 +410,7 @@ def build_rename_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -428,9 +428,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -445,7 +445,7 @@ def build_pause_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -462,9 +462,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +479,7 @@ def build_resume_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -495,9 +495,9 @@ def build_upgrade_data_warehouse_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -510,7 +510,7 @@ def build_upgrade_data_warehouse_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -524,9 +524,9 @@ def build_list_by_elastic_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -541,7 +541,7 @@ def build_list_by_elastic_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -558,9 +558,9 @@ def build_list_inaccessible_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -574,7 +574,7 @@ def build_list_inaccessible_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -628,8 +628,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -654,12 +654,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -667,13 +667,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 @@ -686,7 +686,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -709,8 +711,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -734,12 +736,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -747,13 +749,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionListResult", 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 @@ -766,7 +768,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -789,10 +793,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -816,12 +820,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -829,13 +833,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -848,7 +852,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> _models.Database: @@ -877,10 +883,10 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -893,9 +899,9 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** params=_params, ) 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 ) @@ -912,7 +918,9 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _create_or_update_initial( self, @@ -933,11 +941,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -961,9 +969,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 ) @@ -985,7 +993,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload def begin_create_or_update( @@ -1102,16 +1112,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, server_name=server_name, database_name=database_name, @@ -1132,7 +1142,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: @@ -1144,9 +1154,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1162,10 +1174,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1178,9 +1190,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 ) @@ -1193,7 +1205,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @distributed_trace def begin_delete( @@ -1223,13 +1237,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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, @@ -1248,7 +1262,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: @@ -1260,9 +1274,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _update_initial( self, @@ -1283,11 +1299,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1311,9 +1327,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 ) @@ -1332,7 +1348,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload def begin_update( @@ -1449,16 +1467,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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, server_name=server_name, database_name=database_name, @@ -1479,7 +1497,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: @@ -1491,9 +1509,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.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _export_initial( self, @@ -1514,11 +1534,11 @@ def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1542,9 +1562,9 @@ def _export_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 ) @@ -1563,7 +1583,9 @@ def _export_initial( return deserialized - _export_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + _export_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } @overload def begin_export( @@ -1683,16 +1705,16 @@ def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( # type: ignore + raw_result = self._export_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1713,7 +1735,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: @@ -1725,9 +1747,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_export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + begin_export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1748,10 +1772,10 @@ def _failover_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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1765,9 +1789,9 @@ def _failover_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 ) @@ -1780,7 +1804,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } @distributed_trace def begin_failover( @@ -1818,13 +1844,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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_initial( # type: ignore resource_group_name=resource_group_name, @@ -1844,7 +1870,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: @@ -1856,9 +1882,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.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } def _import_method_initial( self, @@ -1879,11 +1907,11 @@ def _import_method_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1907,9 +1935,9 @@ def _import_method_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 ) @@ -1928,7 +1956,9 @@ def _import_method_initial( return deserialized - _import_method_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + _import_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload def begin_import_method( @@ -2048,16 +2078,16 @@ def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( # type: ignore + raw_result = self._import_method_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2078,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: @@ -2090,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_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + begin_import_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload def rename( # pylint: disable=inconsistent-return-statements @@ -2196,11 +2228,11 @@ def rename( # 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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 @@ -2224,9 +2256,9 @@ def rename( # 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 ) @@ -2239,7 +2271,9 @@ def rename( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - rename.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move"} # type: ignore + rename.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move" + } def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2255,10 +2289,10 @@ def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -2271,9 +2305,9 @@ def _pause_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 ) @@ -2292,7 +2326,9 @@ def _pause_initial( return deserialized - _pause_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } @distributed_trace def begin_pause( @@ -2322,15 +2358,15 @@ def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = 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._pause_initial( # type: ignore + raw_result = self._pause_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2349,7 +2385,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: @@ -2361,9 +2397,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_pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2379,10 +2417,10 @@ def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -2395,9 +2433,9 @@ def _resume_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 ) @@ -2416,7 +2454,9 @@ def _resume_initial( return deserialized - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } @distributed_trace def begin_resume( @@ -2446,15 +2486,15 @@ def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = 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._resume_initial( # type: ignore + raw_result = self._resume_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2473,7 +2513,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: @@ -2485,9 +2525,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_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2503,10 +2545,10 @@ def _upgrade_data_warehouse_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", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( resource_group_name=resource_group_name, @@ -2519,9 +2561,9 @@ def _upgrade_data_warehouse_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 ) @@ -2534,7 +2576,9 @@ def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _upgrade_data_warehouse_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + _upgrade_data_warehouse_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def begin_upgrade_data_warehouse( @@ -2564,13 +2608,13 @@ def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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._upgrade_data_warehouse_initial( # type: ignore resource_group_name=resource_group_name, @@ -2589,7 +2633,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: @@ -2601,9 +2645,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_upgrade_data_warehouse.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + begin_upgrade_data_warehouse.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def list_by_elastic_pool( @@ -2626,10 +2672,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2653,12 +2699,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2666,13 +2712,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -2685,7 +2731,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases" + } @distributed_trace def list_inaccessible_by_server( @@ -2706,10 +2754,10 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2732,12 +2780,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2745,13 +2793,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseListResult", 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 @@ -2764,4 +2812,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_inaccessible_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases"} # type: ignore + list_inaccessible_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py index 328968485a7c..862ac55b02a1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py @@ -46,9 +46,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -72,9 +72,9 @@ def build_get_request(location_name: str, deleted_server_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_get_request(location_name: str, deleted_server_name: str, subscription "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -103,9 +103,9 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -135,9 +135,9 @@ def build_recover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +151,7 @@ def build_recover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -193,10 +193,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -230,13 +230,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DeletedServerListResult", 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 @@ -249,7 +249,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} @distributed_trace def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: @@ -275,10 +275,10 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] + ) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -290,9 +290,9 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m params=_params, ) 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 ) @@ -309,7 +309,9 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}" + } @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_models.DeletedServer"]: @@ -325,10 +327,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -350,12 +352,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -363,13 +365,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DeletedServerListResult", 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 @@ -382,7 +384,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers" + } def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any @@ -398,10 +402,10 @@ def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DeletedServer]] + ) + cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( location_name=location_name, @@ -413,9 +417,9 @@ def _recover_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 ) @@ -434,7 +438,9 @@ def _recover_initial( return deserialized - _recover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + _recover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } @distributed_trace def begin_recover( @@ -462,15 +468,15 @@ def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.DeletedServer] = 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._recover_initial( # type: ignore + raw_result = self._recover_initial( location_name=location_name, deleted_server_name=deleted_server_name, api_version=api_version, @@ -488,7 +494,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: @@ -500,6 +506,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_recover.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + begin_recover.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py index 6f9008e6b055..3b4180e0856e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -184,7 +184,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -202,10 +202,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -222,7 +222,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -274,10 +274,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroupsListResult] + ) + cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -300,12 +300,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -313,13 +313,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DistributedAvailabilityGroupsListResult", 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 @@ -332,7 +332,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups" + } @distributed_trace def get( @@ -367,10 +369,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] + ) + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -383,9 +385,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 ) @@ -402,7 +404,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _create_or_update_initial( self, @@ -423,11 +427,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -451,9 +455,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 ) @@ -475,7 +479,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload def begin_create_or_update( @@ -595,16 +601,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - 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.DistributedAvailabilityGroup] = 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, managed_instance_name=managed_instance_name, distributed_availability_group_name=distributed_availability_group_name, @@ -625,7 +631,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: @@ -637,9 +643,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -659,10 +667,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -675,9 +683,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 ) @@ -690,7 +698,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @distributed_trace def begin_delete( @@ -724,13 +734,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -749,7 +759,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: @@ -761,9 +771,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _update_initial( self, @@ -784,11 +796,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -812,9 +824,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 ) @@ -833,7 +845,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload def begin_update( @@ -953,16 +967,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - 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.DistributedAvailabilityGroup] = 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, managed_instance_name=managed_instance_name, distributed_availability_group_name=distributed_availability_group_name, @@ -983,7 +997,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: @@ -995,6 +1009,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.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py index c204fc08a7e1..2f45f871c1f9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py @@ -46,7 +46,7 @@ def build_list_by_elastic_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_elastic_pool_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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") @@ -113,8 +113,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,12 +138,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -151,13 +151,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolActivityListResult", 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 @@ -170,4 +170,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py index c2c30f52f2f3..b8c4ae45e9a8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py @@ -46,7 +46,7 @@ def build_list_by_elastic_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_elastic_pool_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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") @@ -113,8 +113,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolDatabaseActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,12 +138,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -151,13 +151,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolDatabaseActivityListResult", 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 @@ -170,4 +170,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py index 4ddbb0c2caf5..78ca6c249529 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py @@ -50,9 +50,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,9 +80,9 @@ def build_list_by_elastic_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_by_elastic_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -158,10 +158,10 @@ def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -175,9 +175,9 @@ def cancel( # 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 ) @@ -190,7 +190,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_elastic_pool( @@ -214,10 +216,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolOperationListResult] + ) + cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -241,12 +243,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -254,13 +256,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolOperationListResult", 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 @@ -273,4 +275,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py index 81676d40bc02..a2f25992f42a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py @@ -54,7 +54,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_metrics_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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") @@ -87,7 +87,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_list_metric_definitions_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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") @@ -119,9 +119,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip is not None: @@ -154,9 +154,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -188,10 +188,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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 @@ -206,7 +206,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -224,9 +224,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -239,7 +239,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -253,10 +253,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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 @@ -271,7 +271,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -289,9 +289,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +304,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -355,8 +355,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -381,12 +381,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -394,13 +394,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 @@ -413,7 +413,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -436,8 +438,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -461,12 +463,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -474,13 +476,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionListResult", 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 @@ -493,7 +495,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -516,10 +520,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolListResult] + ) + cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -543,12 +547,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -556,13 +560,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ElasticPoolListResult", 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 @@ -575,7 +579,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools" + } @distributed_trace def get( @@ -606,10 +612,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] + ) + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -622,9 +628,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 ) @@ -641,7 +647,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _create_or_update_initial( self, @@ -662,11 +670,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -690,9 +698,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 ) @@ -714,7 +722,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload def begin_create_or_update( @@ -833,16 +843,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - 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.ElasticPool] = 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, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -863,7 +873,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: @@ -875,9 +885,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -893,10 +905,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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, @@ -909,9 +921,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 ) @@ -924,7 +936,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @distributed_trace def begin_delete( @@ -954,13 +968,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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, @@ -979,7 +993,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: @@ -991,9 +1005,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _update_initial( self, @@ -1014,11 +1030,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1042,9 +1058,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 ) @@ -1063,7 +1079,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload def begin_update( @@ -1183,16 +1201,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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - 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.ElasticPool] = 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, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -1213,7 +1231,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: @@ -1225,9 +1243,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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -1243,10 +1263,10 @@ def _failover_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["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1259,9 +1279,9 @@ def _failover_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 ) @@ -1274,7 +1294,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } @distributed_trace def begin_failover( @@ -1304,13 +1326,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-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._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1329,7 +1351,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: @@ -1341,6 +1363,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py index 61204adc716a..eeb136ca442f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -123,10 +123,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -163,9 +163,9 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +178,7 @@ def build_revalidate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -224,10 +224,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtectorListResult] + ) + cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -250,12 +250,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -263,13 +263,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("EncryptionProtectorListResult", 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 @@ -282,7 +282,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector" + } @distributed_trace def get( @@ -318,10 +320,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] + ) + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -334,9 +336,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 ) @@ -353,7 +355,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } def _create_or_update_initial( self, @@ -374,11 +378,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.EncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -402,9 +406,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 ) @@ -423,7 +427,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } @overload def begin_create_or_update( @@ -546,16 +552,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] - 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.EncryptionProtector] = 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, server_name=server_name, encryption_protector_name=encryption_protector_name, @@ -576,7 +582,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: @@ -588,9 +594,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.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } def _revalidate_initial( # pylint: disable=inconsistent-return-statements self, @@ -610,10 +618,10 @@ def _revalidate_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -626,9 +634,9 @@ def _revalidate_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 ) @@ -641,7 +649,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def begin_revalidate( @@ -676,13 +686,13 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -701,7 +711,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: @@ -713,6 +723,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_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py index 86ed6efbd561..4e746c0851c9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificateListResult] + ) + cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +171,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -184,13 +184,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("EndpointCertificateListResult", 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 @@ -203,7 +203,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates" + } @distributed_trace def get( @@ -235,10 +237,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificate] + ) + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -251,9 +253,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 ) @@ -270,4 +272,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py index 115bc3d7b55f..8d8555a8ec03 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py @@ -46,9 +46,9 @@ def build_list_by_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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,10 +80,10 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -116,11 +116,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -136,7 +136,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -190,10 +190,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -230,13 +230,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicyListResult", 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 @@ -249,7 +249,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings" + } @distributed_trace def get( @@ -283,11 +285,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -301,9 +303,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 ) @@ -320,7 +322,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload def create_or_update( @@ -433,12 +437,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -463,9 +467,9 @@ def create_or_update( params=_params, ) 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 ) @@ -482,8 +486,10 @@ def create_or_update( deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py index 60a4c18bd86a..88acc4982b42 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,10 +79,10 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -114,11 +114,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -185,10 +185,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -224,13 +224,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ExtendedServerBlobAuditingPolicyListResult", 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 @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings" + } @distributed_trace def get( @@ -275,11 +277,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -292,9 +294,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 ) @@ -311,7 +313,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } def _create_or_update_initial( self, @@ -331,12 +335,12 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -360,9 +364,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 ) @@ -381,7 +385,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload def begin_create_or_update( @@ -501,17 +507,17 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] - 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.ExtendedServerBlobAuditingPolicy] = 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, server_name=server_name, parameters=parameters, @@ -532,7 +538,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: @@ -544,6 +550,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py index e7ceb0e490d0..901eade427a9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,10 +147,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -165,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -184,9 +184,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -217,9 +217,9 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +234,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -251,9 +251,9 @@ def build_force_failover_allow_data_loss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +268,7 @@ def build_force_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -327,10 +327,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] + ) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -343,9 +343,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 ) @@ -362,7 +362,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _create_or_update_initial( self, @@ -383,11 +385,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -411,9 +413,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 ) @@ -435,7 +437,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload def begin_create_or_update( @@ -555,16 +559,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - 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.FailoverGroup] = 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, server_name=server_name, failover_group_name=failover_group_name, @@ -585,7 +589,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: @@ -597,9 +601,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -615,10 +621,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -631,9 +637,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 ) @@ -646,7 +652,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def begin_delete( @@ -676,13 +684,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -701,7 +709,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: @@ -713,9 +721,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _update_initial( self, @@ -736,11 +746,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -764,9 +774,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 ) @@ -785,7 +795,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload def begin_update( @@ -905,16 +917,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - 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.FailoverGroup] = 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, server_name=server_name, failover_group_name=failover_group_name, @@ -935,7 +947,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: @@ -947,9 +959,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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_server( @@ -970,10 +984,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroupListResult] + ) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -996,12 +1010,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1009,13 +1023,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("FailoverGroupListResult", 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 @@ -1028,7 +1042,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -1044,10 +1060,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1060,9 +1076,9 @@ def _failover_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 ) @@ -1081,7 +1097,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } @distributed_trace def begin_failover( @@ -1112,15 +1130,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.FailoverGroup] = 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_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -1139,7 +1157,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: @@ -1151,9 +1169,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -1169,10 +1189,10 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -1185,9 +1205,9 @@ def _force_failover_allow_data_loss_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 ) @@ -1206,7 +1226,9 @@ def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_force_failover_allow_data_loss( @@ -1238,15 +1260,15 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.FailoverGroup] = 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._force_failover_allow_data_loss_initial( # type: ignore + raw_result = self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -1265,7 +1287,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: @@ -1277,6 +1299,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_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py index d0fa6f5a062d..81e938a70ff0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py @@ -46,9 +46,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,10 +80,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -98,7 +98,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -131,7 +131,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +145,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +161,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -178,10 +178,10 @@ def build_replace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -195,7 +195,7 @@ def build_replace_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -256,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -272,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 ) @@ -291,7 +291,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @overload def create_or_update( @@ -395,11 +397,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -423,9 +425,9 @@ def create_or_update( params=_params, ) 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 ) @@ -442,11 +444,13 @@ def create_or_update( deserialized = self._deserialize("FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -477,10 +481,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -493,9 +497,9 @@ def delete( # 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 ) @@ -508,7 +512,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def list_by_server( @@ -529,10 +535,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRuleListResult] + ) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +561,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -568,13 +574,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("FirewallRuleListResult", 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 @@ -587,7 +593,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } @overload def replace( @@ -677,11 +685,11 @@ def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -704,9 +712,9 @@ def replace( params=_params, ) 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,4 +733,6 @@ def replace( return deserialized - replace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + replace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py index cc708fc2d520..19b94ce7c395 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py @@ -51,8 +51,8 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_create_or_update_request( "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_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") @@ -92,7 +92,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_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") @@ -125,7 +125,7 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +140,7 @@ def build_list_by_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") @@ -283,9 +283,9 @@ def 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -310,9 +310,9 @@ def create_or_update( params=_params, ) 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 ) @@ -329,11 +329,13 @@ def create_or_update( deserialized = self._deserialize("GeoBackupPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def get( @@ -371,8 +373,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -386,9 +388,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 ) @@ -405,7 +407,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def list_by_database( @@ -428,8 +432,8 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicyListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -453,12 +457,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -466,13 +470,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GeoBackupPolicyListResult", 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 @@ -485,4 +489,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py index 26df1a901dea..0fb956b47ca2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,9 +180,9 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,9 +214,9 @@ def build_force_failover_allow_data_loss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +231,7 @@ def build_force_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -290,10 +290,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] + ) + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +306,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 ) @@ -325,7 +325,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } def _create_or_update_initial( self, @@ -346,11 +348,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -374,9 +376,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 ) @@ -398,7 +400,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @overload def begin_create_or_update( @@ -518,16 +522,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - 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.InstanceFailoverGroup] = 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, location_name=location_name, failover_group_name=failover_group_name, @@ -548,7 +552,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: @@ -560,9 +564,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -578,10 +584,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -594,9 +600,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 ) @@ -609,7 +615,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def begin_delete( @@ -639,13 +647,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -664,7 +672,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: @@ -676,9 +684,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.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_location( @@ -700,10 +710,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroupListResult] + ) + cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -726,12 +736,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -739,13 +749,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("InstanceFailoverGroupListResult", 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 @@ -758,7 +768,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups" + } def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -774,10 +786,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -790,9 +802,9 @@ def _failover_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 ) @@ -811,7 +823,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } @distributed_trace def begin_failover( @@ -842,15 +856,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.InstanceFailoverGroup] = 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_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -869,7 +883,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: @@ -881,9 +895,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -899,10 +915,10 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -915,9 +931,9 @@ def _force_failover_allow_data_loss_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 ) @@ -936,7 +952,9 @@ def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_force_failover_allow_data_loss( @@ -968,15 +986,15 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( # type: ignore + raw_result = self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -995,7 +1013,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: @@ -1007,6 +1025,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_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py index 17ad2e19db3d..c4c056da58cf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,10 +81,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -98,7 +98,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -130,7 +130,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -161,7 +161,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -178,9 +178,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +193,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -208,9 +208,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +219,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -274,10 +274,10 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] + ) + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -289,9 +289,9 @@ def get(self, resource_group_name: str, instance_pool_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 = 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 ) @@ -308,7 +308,9 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _create_or_update_initial( self, @@ -328,11 +330,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -355,9 +357,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 ) @@ -379,7 +381,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload def begin_create_or_update( @@ -490,16 +494,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - 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.InstancePool] = 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, instance_pool_name=instance_pool_name, parameters=parameters, @@ -519,7 +523,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: @@ -531,9 +535,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any @@ -549,10 +555,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -564,9 +570,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 ) @@ -579,7 +585,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.Sql/instancePools/{instancePoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> LROPoller[None]: @@ -605,13 +613,13 @@ def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -629,7 +637,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: @@ -641,9 +649,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _update_initial( self, @@ -663,11 +673,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -690,9 +700,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 ) @@ -711,7 +721,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload def begin_update( @@ -822,16 +834,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - 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.InstancePool] = 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, instance_pool_name=instance_pool_name, parameters=parameters, @@ -851,7 +863,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: @@ -863,9 +875,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.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.InstancePool"]: @@ -882,10 +896,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -907,12 +921,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -920,13 +934,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("InstancePoolListResult", 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 @@ -939,7 +953,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.Sql/instancePools"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: @@ -953,10 +969,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -977,12 +993,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -990,13 +1006,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("InstancePoolListResult", 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 @@ -1009,4 +1025,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py index 845be0602373..bb63c2e917b7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -113,10 +113,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -131,7 +131,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -149,9 +149,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +164,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -210,10 +210,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRuleListResult] + ) + cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,12 +236,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -249,13 +249,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IPv6FirewallRuleListResult", 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 @@ -268,7 +268,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules" + } @distributed_trace def get( @@ -299,10 +301,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -315,9 +317,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 ) @@ -334,7 +336,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @overload def create_or_update( @@ -440,11 +444,11 @@ def 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -468,9 +472,9 @@ def create_or_update( params=_params, ) 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 ) @@ -487,11 +491,13 @@ def create_or_update( deserialized = self._deserialize("IPv6FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -522,10 +528,10 @@ def delete( # 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -538,9 +544,9 @@ def delete( # 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 ) @@ -553,4 +559,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py index 2fe4e3514679..17327a6b7565 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,9 +81,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,10 +180,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -198,7 +198,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -247,10 +247,10 @@ def list_by_server(self, resource_group_name: str, server_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgentListResult] + ) + cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -273,12 +273,12 @@ 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: request = HttpRequest("GET", next_link) 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("JobAgentListResult", 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 @@ -305,7 +305,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any) -> _models.JobAgent: @@ -334,10 +336,10 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] + ) + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -350,9 +352,9 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * params=_params, ) 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 ) @@ -369,7 +371,9 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _create_or_update_initial( self, @@ -390,11 +394,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -418,9 +422,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 ) @@ -442,7 +446,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload def begin_create_or_update( @@ -559,16 +565,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - 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.JobAgent] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -589,7 +595,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: @@ -601,9 +607,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any @@ -619,10 +627,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -635,9 +643,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 ) @@ -650,7 +658,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @distributed_trace def begin_delete( @@ -680,13 +690,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -705,7 +715,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: @@ -717,9 +727,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _update_initial( self, @@ -740,11 +752,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -768,9 +780,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 ) @@ -789,7 +801,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload def begin_update( @@ -905,16 +919,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - 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.JobAgent] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -935,7 +949,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: @@ -947,6 +961,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py index 5c02d06e3d86..0812108c5519 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -144,7 +144,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -231,10 +231,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredentialListResult] + ) + cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -258,12 +258,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -271,13 +271,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobCredentialListResult", 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 @@ -290,7 +290,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials" + } @distributed_trace def get( @@ -323,10 +325,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -340,9 +342,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 ) @@ -359,7 +361,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @overload def create_or_update( @@ -472,11 +476,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -501,9 +505,9 @@ def create_or_update( params=_params, ) 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 ) @@ -520,11 +524,13 @@ def create_or_update( deserialized = self._deserialize("JobCredential", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -557,10 +563,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -574,9 +580,9 @@ def delete( # 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 ) @@ -589,4 +595,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py index 2a7cd7c199ab..b6923b4a7b1d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py @@ -61,9 +61,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -114,9 +114,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -131,7 +131,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +145,9 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -193,9 +193,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +211,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -248,9 +248,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +267,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -290,9 +290,9 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -309,7 +309,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -390,10 +390,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -424,12 +424,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -437,13 +437,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -456,7 +456,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions" + } @distributed_trace def cancel( # pylint: disable=inconsistent-return-statements @@ -497,10 +499,10 @@ def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -515,9 +517,9 @@ def cancel( # 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 ) @@ -530,7 +532,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel" + } def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -546,10 +550,10 @@ def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( resource_group_name=resource_group_name, @@ -563,9 +567,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 ) @@ -584,7 +588,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def begin_create( @@ -617,15 +623,15 @@ def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.JobExecution] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -645,7 +651,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: @@ -657,9 +663,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.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def list_by_job( @@ -715,10 +723,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -750,12 +758,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -763,13 +771,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -782,7 +790,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions" + } @distributed_trace def get( @@ -823,10 +833,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -841,9 +851,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 ) @@ -860,7 +870,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } def _create_or_update_initial( self, @@ -882,10 +894,10 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -900,9 +912,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 ) @@ -924,7 +936,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } @distributed_trace def begin_create_or_update( @@ -965,15 +979,15 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.JobExecution] = 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, server_name=server_name, job_agent_name=job_agent_name, @@ -994,7 +1008,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: @@ -1006,6 +1020,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py index c950eb7d9ca1..3c53d244225c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py @@ -61,9 +61,9 @@ def build_list_by_job_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_by_job_execution_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -118,9 +118,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +138,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -225,10 +225,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -261,12 +261,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -274,13 +274,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -293,7 +293,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps" + } @distributed_trace def get( @@ -337,10 +339,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -356,9 +358,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 ) @@ -375,4 +377,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py index e96d1f3f67c5..b8a40b11ea9c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py @@ -52,9 +52,9 @@ def build_list_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_version_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -95,9 +95,9 @@ def build_get_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_by_version_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -132,9 +132,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -173,9 +173,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +192,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -215,10 +215,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -235,7 +235,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -259,9 +259,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -276,7 +276,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -334,10 +334,10 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -363,12 +363,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -376,13 +376,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobStepListResult", 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 @@ -395,7 +395,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps"} # type: ignore + list_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps" + } @distributed_trace def get_by_version( @@ -439,10 +441,10 @@ def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( resource_group_name=resource_group_name, @@ -458,9 +460,9 @@ def get_by_version( params=_params, ) 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 ) @@ -477,7 +479,9 @@ def get_by_version( return deserialized - get_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}"} # type: ignore + get_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}" + } @distributed_trace def list_by_job( @@ -502,10 +506,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -530,12 +534,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -543,13 +547,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobStepListResult", 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 @@ -562,7 +566,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps" + } @distributed_trace def get( @@ -603,10 +609,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -621,9 +627,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 ) @@ -640,7 +646,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @overload def create_or_update( @@ -762,11 +770,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -792,9 +800,9 @@ def create_or_update( params=_params, ) 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 ) @@ -811,11 +819,13 @@ def create_or_update( deserialized = self._deserialize("JobStep", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -856,10 +866,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -874,9 +884,9 @@ def delete( # 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 ) @@ -889,4 +899,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py index 4aa085fe783d..6677dbb8de6c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py @@ -61,9 +61,9 @@ def build_list_by_job_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_by_job_execution_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -126,9 +126,9 @@ def build_list_by_step_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_step_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -185,9 +185,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +206,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -293,10 +293,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -329,12 +329,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -342,13 +342,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -361,7 +361,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets" + } @distributed_trace def list_by_step( @@ -423,10 +425,10 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -460,12 +462,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -473,13 +475,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobExecutionListResult", 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 @@ -492,7 +494,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_step.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets"} # type: ignore + list_by_step.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets" + } @distributed_trace def get( @@ -539,10 +543,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -559,9 +563,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 ) @@ -578,4 +582,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py index 2371b7ece7da..0a7fdf3aad8d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -144,7 +144,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -231,10 +231,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroupListResult] + ) + cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -258,12 +258,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -271,13 +271,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobTargetGroupListResult", 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 @@ -290,7 +290,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups" + } @distributed_trace def get( @@ -323,10 +325,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -340,9 +342,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 ) @@ -359,7 +361,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @overload def create_or_update( @@ -472,11 +476,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -501,9 +505,9 @@ def create_or_update( params=_params, ) 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 ) @@ -520,11 +524,13 @@ def create_or_update( deserialized = self._deserialize("JobTargetGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -557,10 +563,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -574,9 +580,9 @@ def delete( # 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 ) @@ -589,4 +595,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py index 944bdcfd0265..6a11062a062c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py @@ -46,9 +46,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -87,9 +87,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -159,10 +159,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersionListResult] + ) + cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -187,12 +187,12 @@ 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: request = HttpRequest("GET", next_link) 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("JobVersionListResult", 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 @@ -219,7 +219,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions" + } @distributed_trace def get( @@ -260,10 +262,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersion] + ) + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -278,9 +280,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 ) @@ -297,4 +299,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py index a2ae9d3917bf..99d03fa290f5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,9 +80,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -134,7 +134,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -152,9 +152,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -168,7 +168,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -216,10 +216,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobListResult] + ) + cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -243,12 +243,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -256,13 +256,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JobListResult", 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 @@ -275,7 +275,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs" + } @distributed_trace def get( @@ -308,10 +310,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -325,9 +327,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 ) @@ -344,7 +346,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @overload def create_or_update( @@ -456,11 +460,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -485,9 +489,9 @@ def create_or_update( params=_params, ) 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,11 +508,13 @@ def create_or_update( deserialized = self._deserialize("Job", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -541,10 +547,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -558,9 +564,9 @@ def delete( # 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 ) @@ -573,4 +579,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py index 5eff8424b75a..9adee65cf750 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py @@ -53,9 +53,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -131,9 +131,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -170,9 +170,9 @@ def build_disable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +188,7 @@ def build_disable_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] + ) + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,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 ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } def _create_or_update_initial( self, @@ -312,11 +314,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -341,9 +343,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 ) @@ -362,7 +364,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @overload def begin_create_or_update( @@ -493,16 +497,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - 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.LedgerDigestUploads] = 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, server_name=server_name, database_name=database_name, @@ -524,7 +528,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: @@ -536,9 +540,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.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @distributed_trace def list_by_database( @@ -561,10 +567,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploadsListResult] + ) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -588,12 +594,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -601,13 +607,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LedgerDigestUploadsListResult", 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 @@ -620,7 +626,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads" + } def _disable_initial( self, @@ -641,10 +649,10 @@ def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( resource_group_name=resource_group_name, @@ -658,9 +666,9 @@ def _disable_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 ) @@ -679,7 +687,9 @@ def _disable_initial( return deserialized - _disable_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + _disable_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } @distributed_trace def begin_disable( @@ -718,15 +728,15 @@ def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( # type: ignore + raw_result = self._disable_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -746,7 +756,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: @@ -758,6 +768,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_disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + begin_disable.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py index cc3e03e4376b..407854d3d188 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py @@ -53,10 +53,10 @@ def build_copy_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -76,7 +76,7 @@ def build_copy_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -100,10 +100,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -123,7 +123,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -190,9 +190,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -210,7 +210,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -231,9 +231,9 @@ def build_list_by_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -252,7 +252,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -280,9 +280,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +295,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -324,9 +324,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +342,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -371,10 +371,10 @@ def build_copy_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -395,7 +395,7 @@ def build_copy_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -420,10 +420,10 @@ def build_update_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -444,7 +444,7 @@ def build_update_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -469,9 +469,9 @@ def build_get_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -492,7 +492,7 @@ def build_get_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -514,9 +514,9 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -535,7 +535,7 @@ def build_delete_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -557,9 +557,9 @@ def build_list_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -579,7 +579,7 @@ def build_list_by_resource_group_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -608,9 +608,9 @@ def build_list_by_resource_group_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +624,7 @@ def build_list_by_resource_group_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -654,9 +654,9 @@ def build_list_by_resource_group_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -673,7 +673,7 @@ def build_list_by_resource_group_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -729,11 +729,11 @@ def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -758,9 +758,9 @@ def _copy_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 ) @@ -779,7 +779,9 @@ def _copy_initial( return deserialized - _copy_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload def begin_copy( @@ -908,16 +910,16 @@ def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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._copy_initial( # type: ignore + raw_result = self._copy_initial( location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -939,7 +941,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: @@ -951,9 +953,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_copy.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } def _update_initial( self, @@ -975,11 +979,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1004,9 +1008,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 ) @@ -1025,7 +1029,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload def begin_update( @@ -1154,16 +1160,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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( location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -1185,7 +1191,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: @@ -1197,9 +1203,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace def get( @@ -1236,10 +1244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -1253,9 +1261,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 ) @@ -1272,7 +1280,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -1293,10 +1303,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -1310,9 +1320,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 ) @@ -1325,7 +1335,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def begin_delete( @@ -1361,13 +1373,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 location_name=location_name, @@ -1387,7 +1399,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: @@ -1399,9 +1411,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -1436,10 +1450,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1465,12 +1479,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1478,13 +1492,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1497,7 +1511,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_location( @@ -1526,10 +1542,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1553,12 +1569,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1566,13 +1582,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1585,7 +1601,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_server( @@ -1617,10 +1635,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1645,12 +1663,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1658,13 +1676,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -1677,7 +1695,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } def _copy_by_resource_group_initial( self, @@ -1700,11 +1720,11 @@ def _copy_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1730,9 +1750,9 @@ def _copy_by_resource_group_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 ) @@ -1751,7 +1771,9 @@ def _copy_by_resource_group_initial( return deserialized - _copy_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload def begin_copy_by_resource_group( @@ -1892,16 +1914,16 @@ def begin_copy_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( # type: ignore + raw_result = self._copy_by_resource_group_initial( resource_group_name=resource_group_name, location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, @@ -1924,7 +1946,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: @@ -1936,9 +1958,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_copy_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } def _update_by_resource_group_initial( self, @@ -1961,11 +1985,11 @@ def _update_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1991,9 +2015,9 @@ def _update_by_resource_group_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 ) @@ -2012,7 +2036,9 @@ def _update_by_resource_group_initial( return deserialized - _update_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload def begin_update_by_resource_group( @@ -2153,16 +2179,16 @@ def begin_update_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - 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.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( # type: ignore + raw_result = self._update_by_resource_group_initial( resource_group_name=resource_group_name, location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, @@ -2185,7 +2211,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: @@ -2197,9 +2223,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace def get_by_resource_group( @@ -2240,10 +2268,10 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -2258,9 +2286,9 @@ def get_by_resource_group( params=_params, ) 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 ) @@ -2277,7 +2305,9 @@ def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -2299,10 +2329,10 @@ def _delete_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -2317,9 +2347,9 @@ def _delete_by_resource_group_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 ) @@ -2332,7 +2362,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def begin_delete_by_resource_group( @@ -2372,13 +2404,13 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -2399,7 +2431,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: @@ -2411,9 +2443,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -2452,10 +2486,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2482,12 +2516,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2495,13 +2529,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -2514,7 +2548,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_location( @@ -2547,10 +2583,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2575,12 +2611,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2588,13 +2624,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -2607,7 +2643,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_server( @@ -2643,10 +2681,10 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2672,12 +2710,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2685,13 +2723,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionBackupListResult", 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 @@ -2704,4 +2742,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py index fbad34676b1d..c0ecc987f6e1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py @@ -53,9 +53,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -92,9 +92,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -108,7 +108,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -129,9 +129,9 @@ def build_list_by_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -175,9 +175,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -219,9 +219,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +234,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -263,9 +263,9 @@ def build_get_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_get_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -304,9 +304,9 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -321,7 +321,7 @@ def build_delete_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -343,9 +343,9 @@ def build_list_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -361,7 +361,7 @@ def build_list_by_resource_group_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -391,9 +391,9 @@ def build_list_by_resource_group_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +408,7 @@ def build_list_by_resource_group_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -437,9 +437,9 @@ def build_list_by_resource_group_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -453,7 +453,7 @@ def build_list_by_resource_group_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -519,10 +519,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -536,9 +536,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 ) @@ -555,7 +555,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any @@ -571,10 +573,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -588,9 +590,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 ) @@ -603,7 +605,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def begin_delete( @@ -634,13 +638,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 location_name=location_name, @@ -660,7 +664,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: @@ -672,9 +676,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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -710,10 +716,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -739,12 +745,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -752,13 +758,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -771,7 +777,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_instance( @@ -804,10 +812,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -832,12 +840,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -845,13 +853,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -864,7 +872,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_location( @@ -894,10 +904,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -921,12 +931,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -934,13 +944,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -953,7 +963,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def get_by_resource_group( @@ -994,10 +1006,10 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -1012,9 +1024,9 @@ def get_by_resource_group( params=_params, ) 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 ) @@ -1031,7 +1043,9 @@ def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -1053,10 +1067,10 @@ def _delete_by_resource_group_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -1071,9 +1085,9 @@ def _delete_by_resource_group_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 ) @@ -1086,7 +1100,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def begin_delete_by_resource_group( @@ -1126,13 +1142,13 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -1153,7 +1169,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: @@ -1165,9 +1181,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_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -1207,10 +1225,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1237,12 +1255,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1250,13 +1268,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -1269,7 +1287,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_instance( @@ -1306,10 +1326,10 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1335,12 +1355,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1348,13 +1368,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -1367,7 +1387,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_location( @@ -1401,10 +1423,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1429,12 +1451,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1442,13 +1464,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", 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 @@ -1461,4 +1483,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py index a8cbbcf72436..ea3975fc8a28 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py @@ -53,9 +53,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -131,9 +131,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,10 +214,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] + ) + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -231,9 +231,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 ) @@ -250,7 +250,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -272,11 +274,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -301,9 +303,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 ) @@ -322,7 +324,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -451,16 +455,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] - 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.LongTermRetentionPolicy] = 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, server_name=server_name, database_name=database_name, @@ -482,7 +486,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: @@ -494,9 +498,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.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -520,10 +526,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -547,12 +553,12 @@ 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: request = HttpRequest("GET", next_link) 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 +566,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LongTermRetentionPolicyListResult", 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 @@ -579,4 +585,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py index 426128c33112..c7f4f95a9a13 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowOptionsName"] = _SERIALIZER.query( @@ -138,10 +138,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindowOptions] + ) + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -155,9 +155,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 ) @@ -174,4 +174,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py index 37b0273e928e..a65cecaf7a6a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") @@ -92,10 +92,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") @@ -176,10 +176,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindows] + ) + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +193,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 ) @@ -212,7 +212,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } @overload def create_or_update( # pylint: disable=inconsistent-return-statements @@ -324,11 +326,11 @@ def create_or_update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -353,9 +355,9 @@ def create_or_update( # 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 ) @@ -368,4 +370,6 @@ def create_or_update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py index ef741b575eda..704d04fe4b15 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py @@ -53,9 +53,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -136,10 +136,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -155,7 +155,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -174,9 +174,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -257,10 +257,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +274,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 ) @@ -293,7 +293,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -315,11 +317,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -344,9 +346,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 ) @@ -365,7 +367,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -497,16 +501,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -528,7 +532,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: @@ -540,9 +544,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -564,11 +570,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -593,9 +599,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 ) @@ -614,7 +620,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -746,16 +754,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -777,7 +785,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: @@ -789,9 +797,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -816,10 +826,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -843,12 +853,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -856,13 +866,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", 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 @@ -875,4 +885,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py index 824405766977..9f4b090b1583 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py @@ -46,9 +46,9 @@ def build_list_by_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -127,10 +127,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -148,7 +148,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -203,10 +203,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -230,12 +230,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -243,13 +243,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtectionListResult", 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 @@ -262,7 +262,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -302,10 +304,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -319,9 +321,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 ) @@ -338,7 +340,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def create_or_update( @@ -457,11 +461,11 @@ def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -486,9 +490,9 @@ def create_or_update( params=_params, ) 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 ) @@ -505,8 +509,10 @@ def create_or_update( deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py index 58b96e2feac7..f5898bf82a23 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py @@ -56,9 +56,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if schema is not None: @@ -108,9 +108,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_list_by_table_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -153,9 +153,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -244,10 +244,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -289,13 +289,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -345,10 +347,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -375,12 +377,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -388,13 +390,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseColumnListResult", 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 @@ -407,7 +409,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace def get( @@ -451,10 +455,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -470,9 +474,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 ) @@ -489,4 +493,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py index 4560c168faf5..e31f9ee79f1a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py @@ -52,9 +52,9 @@ def build_list_by_location_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -91,9 +91,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -169,10 +169,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationListResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -197,12 +197,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -210,13 +210,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseMoveOperationListResult", 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 @@ -229,7 +229,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + } @distributed_trace def get( @@ -260,10 +262,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -276,9 +278,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 ) @@ -295,4 +297,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py index 90bf6e466f23..be22382879f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -95,9 +95,9 @@ def build_list_by_query_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_list_by_query_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if start_time is not None: @@ -180,10 +180,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQuery] + ) + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -197,9 +197,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 ) @@ -216,7 +216,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}" + } @distributed_trace def list_by_query( @@ -256,10 +258,10 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQueryStatistics] + ) + cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -287,12 +289,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -300,13 +302,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceQueryStatistics", 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 @@ -319,4 +321,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_query.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics"} # type: ignore + list_by_query.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py index 40d0b63ece51..5a5d458c534a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py @@ -45,10 +45,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -61,7 +61,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -193,11 +193,11 @@ def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -221,9 +221,9 @@ def update( # 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 ) @@ -236,4 +236,6 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py index db08eae7e4aa..ceb69a92576f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py @@ -50,9 +50,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseRestoreDetailsResult] + ) + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -151,9 +151,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 ) @@ -170,4 +170,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py index ea7b606f173f..65cd88993400 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py @@ -52,9 +52,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -93,9 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -170,10 +170,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +198,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -211,13 +211,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseSchemaListResult", 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 @@ -230,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -280,9 +282,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 ) @@ -299,4 +301,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py index 1aaedfd00547..66c277929817 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,10 +91,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -129,9 +129,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,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 ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) 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 ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -482,13 +486,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", 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 @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py index aff249dd0659..df8a7c8df992 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py @@ -55,9 +55,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -150,10 +150,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityEventCollection] + ) + cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -181,12 +181,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -194,13 +194,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityEventCollection", 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 @@ -213,4 +213,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py index 390051b2d5fb..4846ca233d5b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py @@ -54,9 +54,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +75,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -99,11 +99,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -122,7 +122,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,10 +147,10 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -167,7 +167,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -187,10 +187,10 @@ def build_disable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +207,7 @@ def build_disable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -227,10 +227,10 @@ def build_enable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -247,7 +247,7 @@ def build_enable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -269,9 +269,9 @@ def build_list_current_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +286,7 @@ def build_list_current_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -309,10 +309,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -325,7 +325,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -351,9 +351,9 @@ def build_list_recommended_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -368,7 +368,7 @@ def build_list_recommended_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -452,10 +452,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -472,9 +472,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 ) @@ -491,7 +491,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload def create_or_update( @@ -631,12 +633,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -664,9 +666,9 @@ def create_or_update( params=_params, ) 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 ) @@ -683,11 +685,13 @@ def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -734,11 +738,11 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -755,9 +759,9 @@ def delete( # 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 ) @@ -770,7 +774,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -817,11 +823,11 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -838,9 +844,9 @@ def disable_recommendation( # 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 ) @@ -853,7 +859,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -901,11 +909,11 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -922,9 +930,9 @@ def enable_recommendation( # 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 ) @@ -937,7 +945,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def list_current_by_database( @@ -974,10 +984,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1004,12 +1014,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1017,13 +1027,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -1036,7 +1046,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @overload def update( # pylint: disable=inconsistent-return-statements @@ -1139,11 +1151,11 @@ def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -1167,9 +1179,9 @@ def update( # 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 ) @@ -1182,7 +1194,9 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -1220,10 +1234,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1250,12 +1264,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1263,13 +1277,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -1282,4 +1296,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py index 8ca8c08af199..a253dddd73d3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py @@ -53,9 +53,9 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -96,9 +96,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -177,10 +177,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +206,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -219,13 +219,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseTableListResult", 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 @@ -238,7 +238,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace def get( @@ -279,10 +281,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,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 ) @@ -316,4 +318,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py index 7ec83eca14dd..e4b1479adbb5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,10 +91,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -129,9 +129,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,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 ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) 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 ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -482,13 +486,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", 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 @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py index c321248289f3..c718162405f4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -98,10 +98,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -121,7 +121,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -146,9 +146,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -258,9 +258,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 ) @@ -277,7 +277,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload def create_or_update( @@ -420,11 +422,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -451,9 +453,9 @@ def create_or_update( params=_params, ) 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 ) @@ -470,7 +472,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -518,10 +522,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -537,9 +541,9 @@ def delete( # 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 ) @@ -552,4 +556,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py index 0f3faad192d4..d99087148903 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -53,9 +53,9 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_initiate_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -92,9 +92,9 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -135,9 +135,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -178,9 +178,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -249,10 +249,10 @@ def _initiate_scan_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -267,9 +267,9 @@ def _initiate_scan_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 ) @@ -282,7 +282,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def begin_initiate_scan( @@ -323,13 +325,13 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -350,7 +352,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: @@ -362,9 +364,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_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def export( @@ -406,10 +410,10 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -424,9 +428,9 @@ def export( params=_params, ) 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 ) @@ -443,11 +447,13 @@ def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } @distributed_trace def list_by_database( @@ -479,10 +485,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -507,12 +513,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -520,13 +526,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", 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 @@ -539,7 +545,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -581,10 +589,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -599,9 +607,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 ) @@ -618,4 +626,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py index 3cc35863b750..357c619f9bc6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py @@ -51,9 +51,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -114,7 +114,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -137,9 +137,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -155,7 +155,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -169,9 +169,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +186,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,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 ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -408,11 +410,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -437,9 +439,9 @@ def create_or_update( params=_params, ) 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 ) @@ -456,11 +458,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -500,10 +504,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -517,9 +521,9 @@ def delete( # 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 ) @@ -532,7 +536,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -557,10 +563,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -584,12 +590,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -597,13 +603,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", 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 @@ -616,4 +622,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py index 16abdaab2150..960e197f6f6b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py @@ -48,9 +48,9 @@ def build_list_by_instance_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,9 +81,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,10 +180,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -198,7 +198,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -217,10 +217,10 @@ def build_cancel_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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", @@ -233,7 +233,7 @@ def build_cancel_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -251,10 +251,10 @@ def build_complete_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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", @@ -267,7 +267,7 @@ def build_complete_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -285,10 +285,10 @@ def build_complete_restore_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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", @@ -301,7 +301,7 @@ def build_complete_restore_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -319,10 +319,10 @@ def build_start_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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", @@ -335,7 +335,7 @@ def build_start_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -353,9 +353,9 @@ def build_list_inaccessible_by_instance_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -369,7 +369,7 @@ def build_list_inaccessible_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -418,10 +418,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -444,12 +444,12 @@ 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: request = HttpRequest("GET", next_link) 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 +457,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseListResult", 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 @@ -476,7 +476,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases" + } @distributed_trace def get( @@ -507,10 +509,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] + ) + cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -523,9 +525,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 ) @@ -542,7 +544,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _create_or_update_initial( self, @@ -563,11 +567,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -591,9 +595,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 ) @@ -615,7 +619,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload def begin_create_or_update( @@ -735,16 +741,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - 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.ManagedDatabase] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -765,7 +771,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: @@ -777,9 +783,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any @@ -795,10 +803,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -811,9 +819,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 ) @@ -826,7 +834,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @distributed_trace def begin_delete( @@ -856,13 +866,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -881,7 +891,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: @@ -893,9 +903,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _update_initial( self, @@ -916,11 +928,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -944,9 +956,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 ) @@ -965,7 +977,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload def begin_update( @@ -1085,16 +1099,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - 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.ManagedDatabase] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -1115,7 +1129,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: @@ -1127,9 +1141,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _cancel_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1150,11 +1166,11 @@ def _cancel_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1178,9 +1194,9 @@ def _cancel_move_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 ) @@ -1193,7 +1209,9 @@ def _cancel_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _cancel_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + _cancel_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } @overload def begin_cancel_move( @@ -1310,14 +1328,14 @@ def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._cancel_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1338,7 +1356,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: @@ -1350,9 +1368,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_cancel_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + begin_cancel_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } def _complete_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1373,11 +1393,11 @@ def _complete_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1401,9 +1421,9 @@ def _complete_move_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 ) @@ -1416,7 +1436,9 @@ def _complete_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _complete_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + _complete_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } @overload def begin_complete_move( @@ -1533,14 +1555,14 @@ def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._complete_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1561,7 +1583,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: @@ -1573,9 +1595,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_complete_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + begin_complete_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } def _complete_restore_initial( # pylint: disable=inconsistent-return-statements self, @@ -1596,11 +1620,11 @@ def _complete_restore_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1624,9 +1648,9 @@ def _complete_restore_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 ) @@ -1639,7 +1663,9 @@ def _complete_restore_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _complete_restore_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + _complete_restore_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } @overload def begin_complete_restore( @@ -1758,14 +1784,14 @@ def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._complete_restore_initial( # type: ignore resource_group_name=resource_group_name, @@ -1786,7 +1812,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: @@ -1798,9 +1824,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_complete_restore.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + begin_complete_restore.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } def _start_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1821,11 +1849,11 @@ def _start_move_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -1849,9 +1877,9 @@ def _start_move_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 ) @@ -1864,7 +1892,9 @@ def _start_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + _start_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @overload def begin_start_move( @@ -1981,14 +2011,14 @@ def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._start_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -2009,7 +2039,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: @@ -2021,9 +2051,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_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + begin_start_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @distributed_trace def list_inaccessible_by_instance( @@ -2044,10 +2076,10 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2070,12 +2102,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -2083,13 +2115,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedDatabaseListResult", 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 @@ -2102,4 +2134,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_inaccessible_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases"} # type: ignore + list_inaccessible_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py index 9134566f71a2..6488e4781749 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -123,10 +123,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +178,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -225,10 +225,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministratorListResult] + ) + cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -251,12 +251,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -264,13 +264,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAdministratorListResult", 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 @@ -283,7 +283,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators" + } @distributed_trace def get( @@ -318,10 +320,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] + ) + cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -334,9 +336,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 ) @@ -353,7 +355,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } def _create_or_update_initial( self, @@ -374,11 +378,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -402,9 +406,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 ) @@ -426,7 +430,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @overload def begin_create_or_update( @@ -546,16 +552,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] - 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.ManagedInstanceAdministrator] = 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, managed_instance_name=managed_instance_name, administrator_name=administrator_name, @@ -576,7 +582,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: @@ -588,9 +594,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -610,10 +618,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -626,9 +634,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 ) @@ -641,7 +649,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @distributed_trace def begin_delete( @@ -675,13 +685,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -700,7 +710,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: @@ -712,6 +722,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.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py index 2bf5c2f216a7..2ca18e2ba194 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py @@ -48,9 +48,9 @@ def build_list_by_instance_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -198,10 +198,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -224,12 +224,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -237,13 +237,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtectionListResult", 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 @@ -256,7 +256,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -309,9 +311,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 ) @@ -328,7 +330,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } def _create_or_update_initial( self, @@ -349,11 +353,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -377,9 +381,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 ) @@ -398,7 +402,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def begin_create_or_update( @@ -527,16 +533,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] - 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.ManagedInstanceAdvancedThreatProtection] = 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, managed_instance_name=managed_instance_name, advanced_threat_protection_name=advanced_threat_protection_name, @@ -557,7 +563,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: @@ -569,6 +575,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py index ea36c10fd436..6377c05e41df 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -159,9 +159,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,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 ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } def _create_or_update_initial( self, @@ -295,11 +297,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,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 ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @overload def begin_create_or_update( @@ -478,16 +482,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] - 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.ManagedInstanceAzureADOnlyAuthentication] = 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, managed_instance_name=managed_instance_name, authentication_name=authentication_name, @@ -508,7 +512,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: @@ -520,9 +524,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -542,10 +548,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -558,9 +564,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 ) @@ -573,7 +579,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def begin_delete( @@ -608,13 +616,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -633,7 +641,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: @@ -645,9 +653,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.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_instance( @@ -670,10 +680,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -696,12 +706,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -709,13 +719,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", 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 @@ -728,4 +738,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py index 99dc9b670025..81d088b54e7a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py @@ -48,9 +48,9 @@ def build_list_by_managed_instance_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -123,10 +123,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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 @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -192,10 +192,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtcListResult] + ) + cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,12 +218,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -231,13 +231,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceDtcListResult", 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 @@ -250,7 +250,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + } @distributed_trace def get( @@ -281,10 +283,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,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 ) @@ -316,7 +318,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } def _create_or_update_initial( self, @@ -337,11 +341,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -365,9 +369,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 ) @@ -384,7 +388,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } @overload def begin_create_or_update( @@ -504,16 +510,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] - 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.ManagedInstanceDtc] = 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, managed_instance_name=managed_instance_name, dtc_name=dtc_name, @@ -534,7 +540,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: @@ -546,6 +552,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py index 32690627f974..d9329fcbdd50 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py @@ -51,9 +51,9 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_revalidate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -80,9 +80,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -117,9 +117,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -155,10 +155,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -173,7 +173,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -223,10 +223,10 @@ def _revalidate_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -239,9 +239,9 @@ def _revalidate_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 ) @@ -254,7 +254,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def begin_revalidate( @@ -289,13 +291,13 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -314,7 +316,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: @@ -326,9 +328,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_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def list_by_instance( @@ -350,10 +354,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -376,12 +380,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -389,13 +393,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceEncryptionProtectorListResult", 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 @@ -408,7 +412,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector" + } @distributed_trace def get( @@ -444,10 +450,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -460,9 +466,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 ) @@ -479,7 +485,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } def _create_or_update_initial( self, @@ -500,11 +508,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -528,9 +536,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 ) @@ -549,7 +557,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } @overload def begin_create_or_update( @@ -675,16 +685,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] - 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.ManagedInstanceEncryptionProtector] = 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, managed_instance_name=managed_instance_name, encryption_protector_name=encryption_protector_name, @@ -705,7 +715,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: @@ -717,6 +727,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py index 272e02428afb..3e7349b6567f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py @@ -53,9 +53,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -122,10 +122,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -140,7 +140,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -158,9 +158,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -173,7 +173,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -222,10 +222,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKeyListResult] + ) + cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -249,12 +249,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -262,13 +262,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceKeyListResult", 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 @@ -281,7 +281,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys" + } @distributed_trace def get( @@ -312,10 +314,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] + ) + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +330,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 ) @@ -347,7 +349,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } def _create_or_update_initial( self, @@ -368,11 +372,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -396,9 +400,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 ) @@ -420,7 +424,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @overload def begin_create_or_update( @@ -543,16 +549,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] - 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.ManagedInstanceKey] = 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, managed_instance_name=managed_instance_name, key_name=key_name, @@ -573,7 +579,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: @@ -585,9 +591,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any @@ -603,10 +611,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -619,9 +627,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 ) @@ -634,7 +642,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @distributed_trace def begin_delete( @@ -664,13 +674,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -689,7 +699,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: @@ -701,6 +711,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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py index 5c9a122ea2b0..73dc62887640 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py @@ -53,9 +53,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -131,9 +131,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,10 +214,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -231,9 +231,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 ) @@ -250,7 +250,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -272,11 +274,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -301,9 +303,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 ) @@ -322,7 +324,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -454,16 +458,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] - 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.ManagedInstanceLongTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, database_name=database_name, @@ -485,7 +489,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: @@ -497,9 +501,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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -524,10 +530,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -551,12 +557,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -564,13 +570,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", 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 @@ -583,4 +589,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py index 05e88a8c3376..7785477ba17c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py @@ -46,9 +46,9 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -112,9 +112,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -127,7 +127,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -174,10 +174,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperationListResult] + ) + cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -200,12 +200,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -213,13 +213,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceOperationListResult", 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 @@ -232,7 +232,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperation] + ) + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -279,9 +281,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 ) @@ -298,7 +300,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}" + } @distributed_trace def cancel( # pylint: disable=inconsistent-return-statements @@ -329,10 +333,10 @@ def cancel( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -345,9 +349,9 @@ def cancel( # 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 ) @@ -360,4 +364,6 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py index 0819cbf6cbfa..b628ba8c0f0b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -92,10 +92,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +134,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -165,9 +165,9 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -240,10 +240,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -256,9 +256,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 ) @@ -275,7 +275,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -296,11 +298,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -324,9 +326,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 ) @@ -345,7 +347,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -467,16 +471,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] - 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.ManagedInstancePrivateEndpointConnection] = 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, managed_instance_name=managed_instance_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -497,7 +501,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: @@ -509,9 +513,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -527,10 +533,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -543,9 +549,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 ) @@ -558,7 +564,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -588,13 +596,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -613,7 +621,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: @@ -625,9 +633,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.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_managed_instance( @@ -650,10 +660,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -676,12 +686,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -689,13 +699,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", 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 @@ -708,4 +718,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py index 5aee490e6fb0..34a054145113 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py @@ -46,9 +46,9 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -146,10 +146,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLinkListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,12 +172,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -185,13 +185,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstancePrivateLinkListResult", 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 @@ -204,7 +204,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources" + } @distributed_trace def get( @@ -235,10 +237,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLink] + ) + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -251,9 +253,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 ) @@ -270,4 +272,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py index 238081edd8c6..8609b9b294dc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -62,7 +62,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -111,11 +111,11 @@ def _create_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -138,9 +138,9 @@ def _create_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 ) @@ -153,7 +153,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } @overload def begin_create( @@ -261,14 +263,14 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -288,7 +290,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: @@ -300,6 +302,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_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py index d69945e728f6..5d869b6d2678 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py @@ -50,9 +50,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -132,9 +132,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -149,7 +149,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -163,9 +163,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -244,10 +244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,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 ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -394,11 +396,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -422,9 +424,9 @@ def create_or_update( params=_params, ) 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 ) @@ -441,11 +443,13 @@ def create_or_update( deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -482,10 +486,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -498,9 +502,9 @@ def delete( # 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 ) @@ -513,7 +517,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_instance( @@ -537,10 +543,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -563,12 +569,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -576,13 +582,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", 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 @@ -595,4 +601,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py index bc1f240c7024..d0ca04d404e1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py @@ -53,9 +53,9 @@ def build_list_by_instance_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_instance_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -86,9 +86,9 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -116,9 +116,9 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -155,9 +155,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -190,10 +190,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -207,7 +207,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -225,9 +225,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -239,7 +239,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -253,10 +253,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -270,7 +270,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -300,9 +300,9 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +316,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if number_of_queries is not None: @@ -351,9 +351,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -365,7 +365,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if replica_type is not None: @@ -415,10 +415,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -442,12 +442,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -455,13 +455,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -474,7 +474,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.ManagedInstance"]: @@ -490,10 +492,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -515,12 +517,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -528,13 +530,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -547,7 +549,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} @distributed_trace def list_by_resource_group( @@ -568,10 +570,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -594,12 +596,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -607,13 +609,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedInstanceListResult", 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 @@ -626,7 +628,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.Sql/managedInstances"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances" + } @distributed_trace def get( @@ -657,10 +661,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] + ) + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -673,9 +677,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 ) @@ -692,7 +696,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _create_or_update_initial( self, @@ -712,11 +718,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -739,9 +745,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 ) @@ -763,7 +769,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload def begin_create_or_update( @@ -874,16 +882,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - 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.ManagedInstance] = 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, managed_instance_name=managed_instance_name, parameters=parameters, @@ -903,7 +911,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: @@ -915,9 +923,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -933,10 +943,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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, @@ -948,9 +958,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 ) @@ -963,7 +973,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: @@ -989,13 +1001,13 @@ def begin_delete(self, resource_group_name: str, managed_instance_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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, @@ -1013,7 +1025,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: @@ -1025,9 +1037,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _update_initial( self, @@ -1047,11 +1061,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1074,9 +1088,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 ) @@ -1095,7 +1109,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload def begin_update( @@ -1206,16 +1222,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - 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.ManagedInstance] = 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, managed_instance_name=managed_instance_name, parameters=parameters, @@ -1235,7 +1251,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: @@ -1247,9 +1263,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.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def list_by_managed_instance( @@ -1299,10 +1317,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopQueriesListResult] + ) + cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1332,12 +1350,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1345,13 +1363,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TopQueriesListResult", 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 @@ -1364,7 +1382,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1384,10 +1404,10 @@ def _failover_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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1400,9 +1420,9 @@ def _failover_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 ) @@ -1415,7 +1435,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } @distributed_trace def begin_failover( @@ -1450,13 +1472,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1475,7 +1497,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: @@ -1487,6 +1509,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index e166d938bf03..2f533964e20c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -53,9 +53,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -95,10 +95,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -161,7 +161,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -184,9 +184,9 @@ def build_list_by_restorable_dropped_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +203,7 @@ def build_list_by_restorable_dropped_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -269,10 +269,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -286,9 +286,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 ) @@ -305,7 +305,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -327,11 +329,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -356,9 +358,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 ) @@ -377,7 +379,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -509,16 +513,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, restorable_dropped_database_id=restorable_dropped_database_id, @@ -540,7 +544,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: @@ -552,9 +556,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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -576,11 +582,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -605,9 +611,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 ) @@ -626,7 +632,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -758,16 +766,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - 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.ManagedBackupShortTermRetentionPolicy] = 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, managed_instance_name=managed_instance_name, restorable_dropped_database_id=restorable_dropped_database_id, @@ -789,7 +797,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: @@ -801,9 +809,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.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_restorable_dropped_database( @@ -828,10 +838,10 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -855,12 +865,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -868,13 +878,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", 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 @@ -887,4 +897,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_restorable_dropped_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies"} # type: ignore + list_by_restorable_dropped_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py index 3631d486efca..3ef0fd871010 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py @@ -48,9 +48,9 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,9 +81,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,10 +180,10 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -198,7 +198,7 @@ def build_acquire_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -250,10 +250,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAliasListResult] + ) + cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -289,13 +289,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedServerDnsAliasListResult", 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 @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + } @distributed_trace def get( @@ -339,10 +341,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] + ) + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -355,9 +357,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 ) @@ -374,7 +376,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _create_or_update_initial( self, @@ -395,11 +399,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -423,9 +427,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 ) @@ -447,7 +451,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @overload def begin_create_or_update( @@ -566,16 +572,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - 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.ManagedServerDnsAlias] = 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, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -596,7 +602,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: @@ -608,9 +614,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any @@ -626,10 +634,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -642,9 +650,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 ) @@ -657,7 +665,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_delete( @@ -687,13 +697,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -712,7 +722,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: @@ -724,9 +734,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.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _acquire_initial( self, @@ -747,11 +759,11 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -775,9 +787,9 @@ def _acquire_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 ) @@ -796,7 +808,9 @@ def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } @overload def begin_acquire( @@ -915,16 +929,16 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - 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.ManagedServerDnsAlias] = 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._acquire_initial( # type: ignore + raw_result = self._acquire_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -945,7 +959,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: @@ -957,6 +971,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_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py index 57a8bf43bb3a..863e26e8d591 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -127,9 +127,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,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 ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,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 ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] - 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.ManagedServerSecurityAlertPolicy] = 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, managed_instance_name=managed_instance_name, security_alert_policy_name=security_alert_policy_name, @@ -461,7 +465,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: @@ -473,9 +477,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.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_instance( @@ -497,10 +503,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -536,13 +542,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", 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 @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py index a5cef7d36bc1..a3511b5ffd34 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py @@ -44,9 +44,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,10 +92,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,12 +115,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ 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 @@ -147,4 +147,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Sql/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Sql/operations"} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py index be61f85c40ca..cd4a7409904c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py @@ -48,9 +48,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -222,10 +222,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] + ) + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -238,9 +238,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 ) @@ -257,7 +257,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } def _create_or_update_initial( self, @@ -278,11 +280,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OutboundFirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -306,9 +308,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 ) @@ -330,7 +332,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @overload def begin_create_or_update( @@ -449,16 +453,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] - 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.OutboundFirewallRule] = 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, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, @@ -479,7 +483,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: @@ -491,9 +495,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -509,10 +515,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -525,9 +531,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 ) @@ -540,7 +546,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def begin_delete( @@ -570,13 +578,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -595,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(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: @@ -607,9 +615,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.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def list_by_server( @@ -631,10 +641,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRuleListResult] + ) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -657,12 +667,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -670,13 +680,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OutboundFirewallRuleListResult", 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 @@ -689,4 +699,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py index 7e93cb667c4f..d60e1b5e37f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -92,10 +92,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +134,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -165,9 +165,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -240,10 +240,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -256,9 +256,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 ) @@ -275,7 +275,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -296,11 +298,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -324,9 +326,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 ) @@ -345,7 +347,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -464,16 +468,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, server_name=server_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -494,7 +498,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: @@ -506,9 +510,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -524,10 +530,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -540,9 +546,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 ) @@ -555,7 +561,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -585,13 +593,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -610,7 +618,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: @@ -622,9 +630,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.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_server( @@ -646,10 +656,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -672,12 +682,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -685,13 +695,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 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 @@ -704,4 +714,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py index f577f7a96de7..b790656a5a81 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +171,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -184,13 +184,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 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 @@ -203,7 +203,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources" + } @distributed_trace def get( @@ -234,10 +236,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -250,9 +252,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 ) @@ -269,4 +271,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py index a14b26b66fd2..f7bac7ade34a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py @@ -45,10 +45,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -61,7 +61,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -193,11 +193,11 @@ def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -221,9 +221,9 @@ def update( # 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 ) @@ -236,4 +236,6 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py index 6d60d1c4ce5f..36502bf676a6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py @@ -46,7 +46,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_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") @@ -78,7 +78,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_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") @@ -151,8 +151,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabase] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -165,9 +165,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 ) @@ -184,7 +184,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" + } @distributed_trace def list_by_server( @@ -205,8 +207,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabaseListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +231,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RecoverableDatabaseListResult", 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,4 +263,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py index e4c40e1ea255..9701e4e40925 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -83,9 +83,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -150,10 +150,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabaseListResult] + ) + cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,12 +176,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -189,13 +189,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RecoverableManagedDatabaseListResult", 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 @@ -208,7 +208,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases" + } @distributed_trace def get( @@ -239,10 +241,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabase] + ) + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +257,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 ) @@ -274,4 +276,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py index f3ec1aeb8a32..9fc21371db2b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py @@ -48,9 +48,9 @@ def build_list_by_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,9 +82,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -132,7 +132,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -146,9 +146,9 @@ def build_failover_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -181,9 +181,9 @@ def build_failover_allow_data_loss_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -216,9 +216,9 @@ def build_list_by_server_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -232,7 +232,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -283,10 +283,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -310,12 +310,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -323,13 +323,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ReplicationLinkListResult", 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 @@ -342,7 +342,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks" + } @distributed_trace def get( @@ -375,10 +377,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] + ) + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -392,9 +394,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 ) @@ -411,7 +413,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -427,10 +431,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -444,9 +448,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 ) @@ -459,7 +463,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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } @distributed_trace def begin_delete( @@ -491,13 +497,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -517,7 +523,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: @@ -529,9 +535,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.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -547,10 +555,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -564,9 +572,9 @@ def _failover_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 ) @@ -585,7 +593,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } @distributed_trace def begin_failover( @@ -618,15 +628,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ReplicationLink] = 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_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -646,7 +656,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: @@ -658,9 +668,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_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -676,10 +688,10 @@ def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -693,9 +705,9 @@ def _failover_allow_data_loss_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 ) @@ -714,7 +726,9 @@ def _failover_allow_data_loss_initial( return deserialized - _failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + _failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_failover_allow_data_loss( @@ -747,15 +761,15 @@ def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ReplicationLink] = 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_allow_data_loss_initial( # type: ignore + raw_result = self._failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -775,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: @@ -787,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_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + begin_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def list_by_server( @@ -810,10 +826,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -836,12 +852,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -849,13 +865,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ReplicationLinkListResult", 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 @@ -868,4 +884,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py index 41f1acde9109..c1563f103531 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,9 +79,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -148,10 +148,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -174,12 +174,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -187,13 +187,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDroppedDatabaseListResult", 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 @@ -206,7 +206,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases" + } @distributed_trace def get( @@ -237,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabase] + ) + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -253,9 +255,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 ) @@ -272,4 +274,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py index a13ffe951b09..1e1e47ac5e49 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -83,9 +83,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -152,10 +152,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -178,12 +178,12 @@ 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: request = HttpRequest("GET", next_link) 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("RestorableDroppedManagedDatabaseListResult", 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 @@ -210,7 +210,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases" + } @distributed_trace def get( @@ -241,10 +243,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabase] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -257,9 +259,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 ) @@ -276,4 +278,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py index ca7f25fe0b32..ed3a5b1d4b5c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py @@ -48,9 +48,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -124,9 +124,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +142,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -179,7 +179,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -227,10 +227,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointListResult] + ) + cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -254,12 +254,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -267,13 +267,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorePointListResult", 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 @@ -286,7 +286,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } def _create_initial( self, @@ -307,11 +309,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RestorePoint]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -335,9 +337,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 ) @@ -359,7 +361,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @overload def begin_create( @@ -479,16 +483,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] - 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.RestorePoint] = 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, server_name=server_name, database_name=database_name, @@ -509,7 +513,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: @@ -521,9 +525,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.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @distributed_trace def get( @@ -556,10 +562,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] + ) + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -573,9 +579,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 ) @@ -592,7 +598,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -625,10 +633,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -642,9 +650,9 @@ def delete( # 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 ) @@ -657,4 +665,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py index 33471970e1cc..c2b9f50fcb9b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py @@ -54,9 +54,9 @@ def build_list_current_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_current_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -94,10 +94,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -110,7 +110,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -136,9 +136,9 @@ def build_list_recommended_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +153,7 @@ def build_list_recommended_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -184,10 +184,10 @@ def build_enable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -204,7 +204,7 @@ def build_enable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -224,10 +224,10 @@ def build_disable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -244,7 +244,7 @@ def build_disable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -266,9 +266,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +287,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -311,11 +311,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -334,7 +334,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -359,10 +359,10 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -379,7 +379,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -441,10 +441,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -471,12 +471,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -484,13 +484,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -503,7 +503,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @overload def update( # pylint: disable=inconsistent-return-statements @@ -606,11 +608,11 @@ def update( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -634,9 +636,9 @@ def update( # 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 +651,9 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -687,10 +691,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -717,12 +721,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -730,13 +734,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SensitivityLabelListResult", 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 @@ -749,7 +753,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } @distributed_trace def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -797,11 +803,11 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -818,9 +824,9 @@ def enable_recommendation( # 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 ) @@ -833,7 +839,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -880,11 +888,11 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -901,9 +909,9 @@ def disable_recommendation( # 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 ) @@ -916,7 +924,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace def get( @@ -964,10 +974,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -984,9 +994,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 ) @@ -1003,7 +1013,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload def create_or_update( @@ -1143,12 +1155,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1176,9 +1188,9 @@ def create_or_update( params=_params, ) 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 ) @@ -1195,11 +1207,13 @@ def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -1246,11 +1260,11 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -1267,9 +1281,9 @@ def delete( # 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 ) @@ -1282,4 +1296,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py index 959da63c3e93..78e202ed4379 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -197,10 +197,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -223,12 +223,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -236,13 +236,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LogicalServerAdvancedThreatProtectionListResult", 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 @@ -255,7 +255,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -292,10 +294,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] + ) + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -308,9 +310,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 ) @@ -327,7 +329,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } def _create_or_update_initial( self, @@ -348,11 +352,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -376,9 +380,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 ) @@ -397,7 +401,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def begin_create_or_update( @@ -523,16 +529,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] - 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.ServerAdvancedThreatProtection] = 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, server_name=server_name, advanced_threat_protection_name=advanced_threat_protection_name, @@ -553,7 +559,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: @@ -565,6 +571,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py index 5c5c60e7e4f9..4cc0e6ab8639 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py @@ -45,9 +45,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -80,9 +80,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -114,10 +114,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -132,7 +132,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -193,10 +193,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( resource_group_name=resource_group_name, @@ -209,9 +209,9 @@ def list_by_server( params=_params, ) 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 ) @@ -228,7 +228,9 @@ def list_by_server( return deserialized - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any) -> _models.Advisor: @@ -257,10 +259,10 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -273,9 +275,9 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k params=_params, ) 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 ) @@ -292,7 +294,9 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } @overload def update( @@ -396,11 +400,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +428,9 @@ def update( params=_params, ) 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 ) @@ -443,4 +447,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py index e6d276434bfa..9b71fa7d4cb3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py @@ -43,9 +43,9 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -76,10 +76,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -93,7 +93,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -150,10 +150,10 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -165,9 +165,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod params=_params, ) 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 ) @@ -184,7 +184,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } @overload def update( @@ -279,11 +281,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -306,9 +308,9 @@ def update( params=_params, ) 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 ) @@ -325,4 +327,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py index b434ef68a606..845c52460a5b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -159,9 +159,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] + ) + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,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 ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } def _create_or_update_initial( self, @@ -295,11 +297,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,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 ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @overload def begin_create_or_update( @@ -470,16 +474,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] - 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.ServerAzureADAdministrator] = 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, server_name=server_name, administrator_name=administrator_name, @@ -500,7 +504,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: @@ -512,9 +516,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -534,10 +540,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -550,9 +556,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 ) @@ -565,7 +571,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def begin_delete( @@ -600,13 +608,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -625,7 +633,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: @@ -637,9 +645,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.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def list_by_server( @@ -661,10 +671,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdministratorListResult] + ) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -687,12 +697,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -700,13 +710,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AdministratorListResult", 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 @@ -719,4 +729,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py index eb897f81f503..a704d79cb2b8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -159,9 +159,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,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 ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } def _create_or_update_initial( self, @@ -295,11 +297,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,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 ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @overload def begin_create_or_update( @@ -475,16 +479,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] - 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.ServerAzureADOnlyAuthentication] = 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, server_name=server_name, authentication_name=authentication_name, @@ -505,7 +509,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: @@ -517,9 +521,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -539,10 +545,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -555,9 +561,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 ) @@ -570,7 +576,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def begin_delete( @@ -605,13 +613,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -630,7 +638,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: @@ -642,9 +650,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.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_server( @@ -666,10 +676,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AzureADOnlyAuthListResult] + ) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -692,12 +702,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -705,13 +715,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AzureADOnlyAuthListResult", 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 @@ -724,4 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py index f6cd731d4173..8b91c3c36107 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -79,10 +79,10 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -114,11 +114,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -185,10 +185,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -224,13 +224,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerBlobAuditingPolicyListResult", 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 @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: @@ -273,11 +275,11 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -290,9 +292,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod params=_params, ) 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 ) @@ -309,7 +311,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } def _create_or_update_initial( self, @@ -329,12 +333,12 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -358,9 +362,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 ) @@ -379,7 +383,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } @overload def begin_create_or_update( @@ -499,17 +505,17 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] - 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.ServerBlobAuditingPolicy] = 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, server_name=server_name, parameters=parameters, @@ -530,7 +536,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: @@ -542,6 +548,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py index b6829b2785bd..72d6cbeae399 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py @@ -47,7 +47,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -60,7 +60,7 @@ def build_delete_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_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") @@ -74,7 +74,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_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") @@ -106,8 +106,8 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_create_or_update_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_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") @@ -141,7 +141,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_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") @@ -214,8 +214,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -228,9 +228,9 @@ def delete( # 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 ) @@ -243,7 +243,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def get( @@ -274,8 +276,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -288,9 +290,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 ) @@ -307,7 +309,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } def _create_or_update_initial( self, @@ -328,9 +332,9 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerCommunicationLink]] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -354,9 +358,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 ) @@ -375,7 +379,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @overload def begin_create_or_update( @@ -495,14 +501,14 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerCommunicationLink] = 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, server_name=server_name, communication_link_name=communication_link_name, @@ -523,7 +529,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: @@ -535,9 +541,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.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def list_by_server( @@ -559,8 +567,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLinkListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -583,12 +591,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -596,13 +604,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerCommunicationLinkListResult", 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 @@ -615,4 +623,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py index 6cb10541128e..1bccc8a9b093 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py @@ -52,9 +52,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -127,9 +127,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] + ) + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,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 ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerConnectionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,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 ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,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["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] - 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.ServerConnectionPolicy] = 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, server_name=server_name, connection_policy_name=connection_policy_name, @@ -461,7 +465,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: @@ -473,9 +477,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.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @distributed_trace def list_by_server( @@ -497,10 +503,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicyListResult] + ) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -536,13 +542,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerConnectionPolicyListResult", 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 @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py index c6c1a78e86cf..0da79e9568e5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -85,9 +85,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -125,10 +125,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -197,10 +197,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditSettingsListResult] + ) + cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -223,12 +223,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -236,13 +236,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerDevOpsAuditSettingsListResult", 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 @@ -255,7 +255,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings" + } @distributed_trace def get( @@ -290,10 +292,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] + ) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,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 ) @@ -325,7 +327,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } def _create_or_update_initial( self, @@ -346,11 +350,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -374,9 +378,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 ) @@ -395,7 +399,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } @overload def begin_create_or_update( @@ -515,16 +521,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] - 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.ServerDevOpsAuditingSettings] = 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, server_name=server_name, dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, @@ -545,9 +551,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": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -559,6 +565,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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py index 1f5f473f89c6..e81f85c2f275 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,9 +82,9 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +115,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -130,7 +130,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +144,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +160,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -177,10 +177,10 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -195,7 +195,7 @@ def build_acquire_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -256,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] + ) + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -272,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 ) @@ -291,7 +291,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -307,10 +309,10 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -323,9 +325,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 ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_create_or_update( @@ -378,15 +382,15 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.ServerDnsAlias] = 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, server_name=server_name, dns_alias_name=dns_alias_name, @@ -405,7 +409,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: @@ -417,9 +421,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -435,10 +441,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -451,9 +457,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 ) @@ -466,7 +472,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_delete( @@ -496,13 +504,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -521,7 +529,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: @@ -533,9 +541,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.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def list_by_server( @@ -556,10 +566,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAliasListResult] + ) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -582,12 +592,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -595,13 +605,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerDnsAliasListResult", 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 @@ -614,7 +624,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases" + } def _acquire_initial( self, @@ -635,11 +647,11 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -663,9 +675,9 @@ def _acquire_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 ) @@ -684,7 +696,9 @@ def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } @overload def begin_acquire( @@ -803,16 +817,16 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - 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.ServerDnsAlias] = 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._acquire_initial( # type: ignore + raw_result = self._acquire_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -833,7 +847,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: @@ -845,6 +859,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_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py index cb4151f5e513..6857fbcd2033 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,9 +81,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -212,10 +212,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKeyListResult] + ) + cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -238,12 +238,12 @@ 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: request = HttpRequest("GET", next_link) 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 +251,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerKeyListResult", 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 @@ -270,7 +270,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: @@ -299,10 +301,10 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] + ) + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -315,9 +317,9 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg params=_params, ) 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 ) @@ -334,7 +336,9 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } def _create_or_update_initial( self, @@ -355,11 +359,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -383,9 +387,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 ) @@ -407,7 +411,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @overload def begin_create_or_update( @@ -533,16 +539,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] - 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.ServerKey] = 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, server_name=server_name, key_name=key_name, @@ -563,7 +569,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: @@ -575,9 +581,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any @@ -593,10 +601,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -609,9 +617,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 ) @@ -624,7 +632,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> LROPoller[None]: @@ -652,13 +662,13 @@ def begin_delete(self, resource_group_name: str, server_name: str, key_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -677,7 +687,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: @@ -689,6 +699,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.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py index ce7885e7549b..a37b645ee438 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -111,10 +111,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerOperationListResult] + ) + cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -137,12 +137,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -150,13 +150,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerOperationListResult", 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 @@ -169,4 +169,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py index 9e962fef2ba5..b4a24b55dd62 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py @@ -52,9 +52,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -127,9 +127,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,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 ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,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 ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] - 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.ServerSecurityAlertPolicy] = 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, server_name=server_name, security_alert_policy_name=security_alert_policy_name, @@ -461,7 +465,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: @@ -473,9 +477,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.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_server( @@ -497,10 +503,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -536,13 +542,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", 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 @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py index ea22b68a272a..09ceb33e2892 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -81,9 +81,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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 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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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 @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,10 +214,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificatesListResult] + ) + cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -240,12 +240,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -253,13 +253,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustCertificatesListResult", 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 @@ -272,7 +272,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates" + } @distributed_trace def get( @@ -303,10 +305,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] + ) + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -319,9 +321,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 ) @@ -338,7 +340,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } def _create_or_update_initial( self, @@ -359,11 +363,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustCertificate]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -387,9 +391,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 ) @@ -411,7 +415,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @overload def begin_create_or_update( @@ -531,16 +537,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] - 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.ServerTrustCertificate] = 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, managed_instance_name=managed_instance_name, certificate_name=certificate_name, @@ -561,7 +567,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: @@ -573,9 +579,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any @@ -591,10 +599,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["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -607,9 +615,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 ) @@ -622,7 +630,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @distributed_trace def begin_delete( @@ -652,13 +662,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-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, @@ -677,7 +687,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: @@ -689,6 +699,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.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py index 12d6a6428c3d..e96cb2b83c6e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,9 +180,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +196,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -255,10 +255,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] + ) + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,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 ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } def _create_or_update_initial( self, @@ -311,11 +313,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -339,9 +341,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 ) @@ -363,7 +365,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @overload def begin_create_or_update( @@ -483,16 +487,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] - 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.ServerTrustGroup] = 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, location_name=location_name, server_trust_group_name=server_trust_group_name, @@ -513,7 +517,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: @@ -525,9 +529,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -543,10 +549,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -559,9 +565,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 ) @@ -574,7 +580,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def begin_delete( @@ -604,13 +612,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -629,7 +637,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: @@ -641,9 +649,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.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def list_by_location( @@ -664,10 +674,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -690,12 +700,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -703,13 +713,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustGroupListResult", 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 @@ -722,7 +732,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups" + } @distributed_trace def list_by_instance( @@ -743,10 +755,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -769,12 +781,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -782,13 +794,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerTrustGroupListResult", 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 @@ -801,4 +813,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py index fcbef799b3d3..f04a7c9a917b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py @@ -46,7 +46,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_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") @@ -109,8 +109,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerUsageListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -133,12 +133,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerUsageListResult", 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 @@ -165,4 +165,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py index ed2108f092a3..7c61787afbf8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py @@ -50,9 +50,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -90,10 +90,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -132,9 +132,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -149,7 +149,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -163,9 +163,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -244,10 +244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,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 ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -394,11 +396,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -422,9 +424,9 @@ def create_or_update( params=_params, ) 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 ) @@ -441,11 +443,13 @@ def create_or_update( deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -482,10 +486,10 @@ def delete( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -498,9 +502,9 @@ def delete( # 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 ) @@ -513,7 +517,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_server( @@ -535,10 +541,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -561,12 +567,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -574,13 +580,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", 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 @@ -593,4 +599,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py index 2621e0a9b0aa..543e89d0baf8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py @@ -48,9 +48,9 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -82,9 +82,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -117,10 +117,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -134,7 +134,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -152,9 +152,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,10 +180,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -197,7 +197,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,9 +214,9 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,7 +225,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -244,10 +244,10 @@ def build_import_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -261,7 +261,7 @@ def build_import_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -278,10 +278,10 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -290,7 +290,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -341,10 +341,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -367,12 +367,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -380,13 +380,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerListResult", 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 @@ -399,7 +399,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.Sql/servers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + } @distributed_trace def get( @@ -430,10 +432,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] + ) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -446,9 +448,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 ) @@ -465,7 +467,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO], **kwargs: Any @@ -481,11 +485,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -508,9 +512,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 ) @@ -532,7 +536,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload def begin_create_or_update( @@ -636,16 +642,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - 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.Server] = 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, server_name=server_name, parameters=parameters, @@ -665,7 +671,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: @@ -677,9 +683,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.Sql/servers/{serverName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any @@ -695,10 +703,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -710,9 +718,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 ) @@ -725,7 +733,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.Sql/servers/{serverName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> LROPoller[None]: @@ -751,13 +761,13 @@ def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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, @@ -775,7 +785,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: @@ -787,9 +797,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.Sql/servers/{serverName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.ServerUpdate, IO], **kwargs: Any @@ -805,11 +817,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -832,9 +844,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 ) @@ -853,7 +865,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload def begin_update( @@ -957,16 +971,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - 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.Server] = 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, server_name=server_name, parameters=parameters, @@ -986,7 +1000,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: @@ -998,9 +1012,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.Sql/servers/{serverName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Server"]: @@ -1016,10 +1032,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1041,12 +1057,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1054,13 +1070,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServerListResult", 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 @@ -1073,7 +1089,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} def _import_database_initial( self, @@ -1093,11 +1109,11 @@ def _import_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1120,9 +1136,9 @@ def _import_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 ) @@ -1141,7 +1157,9 @@ def _import_database_initial( return deserialized - _import_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + _import_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload def begin_import_database( @@ -1252,16 +1270,16 @@ def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - 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.ImportExportOperationResult] = 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._import_database_initial( # type: ignore + raw_result = self._import_database_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -1281,7 +1299,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: @@ -1293,9 +1311,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_import_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + begin_import_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload def check_name_availability( @@ -1359,11 +1379,11 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1384,9 +1404,9 @@ def check_name_availability( params=_params, ) 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 ) @@ -1403,4 +1423,6 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability"} # type: ignore + check_name_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py index c5ed12bcf908..faa93f38ee85 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py @@ -46,7 +46,7 @@ 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", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "serviceObjectiveName": _SERIALIZER.url("service_objective_name", service_objective_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") @@ -78,7 +78,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_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") @@ -151,8 +151,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjective] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -165,9 +165,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 ) @@ -184,7 +184,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" + } @distributed_trace def list_by_server( @@ -205,8 +207,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjectiveListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +231,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServiceObjectiveListResult", 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,4 +263,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py index 1eac16f2afc4..8cdf4ce891de 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py @@ -45,9 +45,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -78,10 +78,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -95,7 +95,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -152,10 +152,10 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -167,9 +167,9 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An params=_params, ) 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 ) @@ -186,7 +186,9 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } @overload def create_or_update( @@ -280,11 +282,11 @@ def 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -307,9 +309,9 @@ def create_or_update( params=_params, ) 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 ) @@ -326,4 +328,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py index 9f070a6fafa4..7856b945d228 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py @@ -50,12 +50,12 @@ def build_list_by_sql_vulnerability_assessment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_sql_vulnerability_assessment_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -95,12 +95,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -180,13 +180,13 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -226,13 +226,13 @@ def extract_data(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 @@ -245,7 +245,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace def get( @@ -287,13 +289,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -308,9 +310,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 ) @@ -327,4 +329,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py index f8c0acaf6612..76f8de27296a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py @@ -50,13 +50,13 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -74,7 +74,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -232,14 +232,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -265,9 +265,9 @@ def create_or_update( params=_params, ) 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 ) @@ -284,4 +284,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py index 8dab5200f35f..cf1d4db60810 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py @@ -50,12 +50,12 @@ def build_execute_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -70,7 +70,7 @@ def build_execute_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -116,13 +116,13 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -136,9 +136,9 @@ def _execute_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 ) @@ -151,7 +151,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace def begin_execute( @@ -189,16 +191,16 @@ def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -218,7 +220,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: @@ -230,6 +232,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_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py index 2c2c7dba1aff..9967e947e3c1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py @@ -51,12 +51,12 @@ def build_list_by_baseline_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_baseline_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -98,12 +98,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -146,13 +146,13 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -171,7 +171,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -238,13 +238,13 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -270,12 +270,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -285,13 +285,13 @@ def extract_data(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 @@ -304,7 +304,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace def get( @@ -349,13 +351,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -371,9 +373,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 ) @@ -390,7 +392,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload def create_or_update( @@ -525,14 +529,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -559,9 +563,9 @@ def create_or_update( params=_params, ) 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 ) @@ -578,4 +582,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py index a218a7fcb2bf..3a242bfea3ad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py @@ -50,12 +50,12 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -143,13 +143,13 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -165,9 +165,9 @@ def delete( # 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 ) @@ -180,4 +180,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py index f4cb7ad124c0..fd5ce731df7f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py @@ -51,12 +51,12 @@ def build_list_by_scan_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -98,12 +98,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -189,13 +189,13 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -221,12 +221,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -234,13 +234,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", 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 @@ -253,7 +253,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace def get( @@ -300,13 +302,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -322,9 +324,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 ) @@ -341,4 +343,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py index 72dd9ae3d727..4ce4251a4d91 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py @@ -50,12 +50,12 @@ def build_list_by_sql_vulnerability_assessments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_sql_vulnerability_assessments_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -95,12 +95,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -180,13 +180,13 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -224,13 +224,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecordListResult", 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 @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -285,13 +287,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,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 ) @@ -325,4 +327,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py index c3cc57b42f8f..63bdb22cca96 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py @@ -48,9 +48,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -65,7 +65,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -126,10 +126,10 @@ def delete( # 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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, @@ -142,9 +142,9 @@ def delete( # 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 ) @@ -157,4 +157,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py index 4ef11ff27006..0a28e9e937c8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py @@ -46,9 +46,9 @@ def build_list_by_server_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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -83,9 +83,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -123,10 +123,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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-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 @@ -143,7 +143,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -195,10 +195,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -221,12 +221,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -234,13 +234,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", 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 @@ -253,7 +253,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + } @distributed_trace def get( @@ -290,10 +292,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,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 ) @@ -325,7 +327,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -431,11 +435,11 @@ def 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-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -459,9 +463,9 @@ def create_or_update( params=_params, ) 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 ) @@ -478,8 +482,10 @@ def create_or_update( deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py index 8a8f4b0483c4..0c134d3208ab 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py @@ -44,9 +44,9 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -73,9 +73,9 @@ def build_get_request(location_name: str, usage_name: 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(location_name: str, usage_name: str, subscription_id: str, "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -133,10 +133,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsageListResult] + ) + cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -158,12 +158,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -171,13 +171,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SubscriptionUsageListResult", 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 @@ -190,7 +190,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" + } @distributed_trace def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: @@ -216,10 +218,10 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsage] + ) + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -231,9 +233,9 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub params=_params, ) 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 ) @@ -250,4 +252,6 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py index 825672a47378..6f655f266f51 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py @@ -46,9 +46,9 @@ def build_list_by_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SynapseLinkWorkspaceListResult] + ) + cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -142,12 +142,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -155,13 +155,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SynapseLinkWorkspaceListResult", 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 @@ -174,4 +174,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py index a82ba6f1f81d..79dbbaa0cea8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -180,9 +180,9 @@ def build_generate_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_generate_key_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -214,9 +214,9 @@ def build_list_linked_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +231,7 @@ def build_list_linked_databases_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -288,10 +288,10 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] + ) + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -304,9 +304,9 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, params=_params, ) 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 ) @@ -323,7 +323,9 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } def _create_or_update_initial( self, @@ -344,11 +346,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -372,9 +374,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 ) @@ -396,7 +398,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @overload def begin_create_or_update( @@ -513,16 +517,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] - 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.SyncAgent] = 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, server_name=server_name, sync_agent_name=sync_agent_name, @@ -543,7 +547,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: @@ -555,9 +559,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -573,10 +579,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -589,9 +595,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 ) @@ -604,7 +610,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def begin_delete( @@ -634,13 +642,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -659,7 +667,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: @@ -671,9 +679,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.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def list_by_server( @@ -694,10 +704,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentListResult] + ) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -720,12 +730,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -733,13 +743,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncAgentListResult", 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 @@ -752,7 +762,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents" + } @distributed_trace def generate_key( @@ -783,10 +795,10 @@ def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentKeyProperties] + ) + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( resource_group_name=resource_group_name, @@ -799,9 +811,9 @@ def generate_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 ) @@ -818,7 +830,9 @@ def generate_key( return deserialized - generate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey"} # type: ignore + generate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey" + } @distributed_trace def list_linked_databases( @@ -842,10 +856,10 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentLinkedDatabaseListResult] + ) + cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -869,12 +883,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -882,13 +896,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncAgentLinkedDatabaseListResult", 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 @@ -901,4 +915,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_linked_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases"} # type: ignore + list_linked_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py index 89f12e838616..2cf4189d5610 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py @@ -46,9 +46,9 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,9 +82,9 @@ def build_refresh_hub_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -98,7 +98,7 @@ def build_refresh_hub_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -117,9 +117,9 @@ def build_list_hub_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_list_hub_schemas_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -162,9 +162,9 @@ def build_list_logs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +180,7 @@ def build_list_logs_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") @@ -208,9 +208,9 @@ def build_cancel_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -224,7 +224,7 @@ def build_cancel_sync_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -242,9 +242,9 @@ def build_trigger_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -258,7 +258,7 @@ def build_trigger_sync_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -277,9 +277,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +295,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -317,10 +317,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -336,7 +336,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -359,9 +359,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -375,7 +375,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -394,10 +394,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -413,7 +413,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -432,9 +432,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -449,7 +449,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -494,10 +494,10 @@ def list_sync_database_ids(self, location_name: str, **kwargs: Any) -> Iterable[ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncDatabaseIdListResult] + ) + cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -519,12 +519,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -532,13 +532,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncDatabaseIdListResult", 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 @@ -551,7 +551,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sync_database_ids.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds"} # type: ignore + list_sync_database_ids.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" + } def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -567,10 +569,10 @@ def _refresh_hub_schema_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( resource_group_name=resource_group_name, @@ -584,9 +586,9 @@ def _refresh_hub_schema_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 ) @@ -599,7 +601,9 @@ def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _refresh_hub_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + _refresh_hub_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def begin_refresh_hub_schema( @@ -631,13 +635,13 @@ def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._refresh_hub_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -657,7 +661,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: @@ -669,9 +673,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_refresh_hub_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + begin_refresh_hub_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def list_hub_schemas( @@ -697,10 +703,10 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -725,12 +731,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -738,13 +744,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", 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 @@ -757,7 +763,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_hub_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas"} # type: ignore + list_hub_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas" + } @distributed_trace def list_logs( @@ -802,10 +810,10 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupLogListResult] + ) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -834,12 +842,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -847,13 +855,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncGroupLogListResult", 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 @@ -866,7 +874,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs"} # type: ignore + list_logs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs" + } @distributed_trace def cancel_sync( # pylint: disable=inconsistent-return-statements @@ -899,10 +909,10 @@ def cancel_sync( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( resource_group_name=resource_group_name, @@ -916,9 +926,9 @@ def cancel_sync( # 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 ) @@ -931,7 +941,9 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync"} # type: ignore + cancel_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync" + } @distributed_trace def trigger_sync( # pylint: disable=inconsistent-return-statements @@ -964,10 +976,10 @@ def trigger_sync( # 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( resource_group_name=resource_group_name, @@ -981,9 +993,9 @@ def trigger_sync( # 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 ) @@ -996,7 +1008,9 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - trigger_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync"} # type: ignore + trigger_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync" + } @distributed_trace def get( @@ -1029,10 +1043,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] + ) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -1046,9 +1060,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 ) @@ -1065,7 +1079,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _create_or_update_initial( self, @@ -1087,11 +1103,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1116,9 +1132,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 ) @@ -1140,7 +1156,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload def begin_create_or_update( @@ -1266,16 +1284,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - 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.SyncGroup] = 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, server_name=server_name, database_name=database_name, @@ -1297,7 +1315,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: @@ -1309,9 +1327,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -1327,10 +1347,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -1344,9 +1364,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 ) @@ -1359,7 +1379,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def begin_delete( @@ -1391,13 +1413,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -1417,7 +1439,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: @@ -1429,9 +1451,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _update_initial( self, @@ -1453,11 +1477,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1482,9 +1506,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 ) @@ -1503,7 +1527,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload def begin_update( @@ -1629,16 +1655,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - 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.SyncGroup] = 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, server_name=server_name, database_name=database_name, @@ -1660,7 +1686,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: @@ -1672,9 +1698,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def list_by_database( @@ -1697,10 +1725,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupListResult] + ) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1724,12 +1752,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1737,13 +1765,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncGroupListResult", 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 @@ -1756,4 +1784,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py index 0baa4a06fb9d..dad008521cbf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py @@ -54,9 +54,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -96,10 +96,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +140,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -157,7 +157,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -177,10 +177,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -197,7 +197,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -221,9 +221,9 @@ def build_list_by_sync_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +239,7 @@ def build_list_by_sync_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -262,9 +262,9 @@ def build_list_member_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +281,7 @@ def build_list_member_schemas_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -303,9 +303,9 @@ def build_refresh_member_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +320,7 @@ def build_refresh_member_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -387,10 +387,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] + ) + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -405,9 +405,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 ) @@ -424,7 +424,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _create_or_update_initial( self, @@ -447,11 +449,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -477,9 +479,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 ) @@ -501,7 +503,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload def begin_create_or_update( @@ -639,16 +643,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - 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.SyncMember] = 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, server_name=server_name, database_name=database_name, @@ -671,7 +675,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: @@ -683,9 +687,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -707,10 +713,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -725,9 +731,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 ) @@ -740,7 +746,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def begin_delete( @@ -781,13 +789,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -808,7 +816,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: @@ -820,9 +828,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _update_initial( self, @@ -845,11 +855,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -875,9 +885,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 ) @@ -896,7 +906,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload def begin_update( @@ -1034,16 +1046,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - 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.SyncMember] = 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, server_name=server_name, database_name=database_name, @@ -1066,7 +1078,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: @@ -1078,9 +1090,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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def list_by_sync_group( @@ -1105,10 +1119,10 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMemberListResult] + ) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1133,12 +1147,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1146,13 +1160,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncMemberListResult", 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 @@ -1165,7 +1179,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sync_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers"} # type: ignore + list_by_sync_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers" + } @distributed_trace def list_member_schemas( @@ -1200,10 +1216,10 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1229,12 +1245,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -1242,13 +1258,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", 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 @@ -1261,7 +1277,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_member_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas"} # type: ignore + list_member_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas" + } def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-statements self, @@ -1283,10 +1301,10 @@ def _refresh_member_schema_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( resource_group_name=resource_group_name, @@ -1301,9 +1319,9 @@ def _refresh_member_schema_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 ) @@ -1316,7 +1334,9 @@ def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _refresh_member_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + _refresh_member_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } @distributed_trace def begin_refresh_member_schema( @@ -1357,13 +1377,13 @@ def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._refresh_member_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -1384,7 +1404,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: @@ -1396,6 +1416,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_refresh_member_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + begin_refresh_member_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py index 13273759e9d5..c0759bf8c622 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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", @@ -62,7 +62,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -107,11 +107,11 @@ def _create_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -134,9 +134,9 @@ def _create_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 ) @@ -149,7 +149,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } @overload def begin_create( @@ -253,14 +255,14 @@ 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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -280,7 +282,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: @@ -292,6 +294,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_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py index 0c1617b979fe..9696ee9e2e62 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py @@ -44,9 +44,9 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -73,9 +73,9 @@ def build_get_request(location_name: str, time_zone_id: str, subscription_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(location_name: str, time_zone_id: str, subscription_id: st "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -133,10 +133,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZoneListResult] + ) + cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -158,12 +158,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -171,13 +171,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TimeZoneListResult", 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 @@ -190,7 +190,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" + } @distributed_trace def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: @@ -216,10 +218,10 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZone] + ) + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -231,9 +233,9 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T params=_params, ) 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 ) @@ -250,4 +252,6 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py index 7ac35659b652..fcc37ed82013 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py @@ -51,9 +51,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -91,10 +91,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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-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 @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -129,9 +129,9 @@ def build_list_by_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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryption] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,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 ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def 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["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) 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 ) @@ -418,7 +420,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -444,10 +448,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -471,12 +475,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -484,13 +488,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryptionListResult", 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 @@ -503,4 +507,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py index 6037657e10c7..4745ee01a5af 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py @@ -51,9 +51,9 @@ def build_list_by_instance_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_by_instance_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand_children is not None: @@ -121,10 +121,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult] + ) + cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -148,12 +148,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -161,13 +161,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsageListResult", 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 @@ -180,4 +180,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py index 32716f62c57b..29398edd1dad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py @@ -46,9 +46,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -72,9 +72,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -104,9 +104,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -136,9 +136,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -150,7 +150,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -164,10 +164,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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 @@ -181,7 +181,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -200,9 +200,9 @@ def build_update_dns_servers_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +216,7 @@ def build_update_dns_servers_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -258,10 +258,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -282,12 +282,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -295,13 +295,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("VirtualClusterListResult", 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 @@ -314,7 +314,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: @@ -331,10 +331,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -356,12 +356,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -369,13 +369,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("VirtualClusterListResult", 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 @@ -388,7 +388,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.Sql/virtualClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters" + } @distributed_trace def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: @@ -415,10 +417,10 @@ def get(self, resource_group_name: str, virtual_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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] + ) + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -430,9 +432,9 @@ def get(self, resource_group_name: str, virtual_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 = 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 ) @@ -449,7 +451,9 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -465,10 +469,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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, @@ -480,9 +484,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 ) @@ -495,7 +499,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -521,13 +527,13 @@ def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-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, @@ -545,7 +551,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: @@ -557,9 +563,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _update_initial( self, @@ -579,11 +587,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualCluster]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -606,9 +614,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 ) @@ -627,7 +635,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @overload def begin_update( @@ -738,16 +748,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-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] - 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.VirtualCluster] = 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, virtual_cluster_name=virtual_cluster_name, parameters=parameters, @@ -767,7 +777,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: @@ -779,9 +789,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.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -797,10 +809,10 @@ def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] + ) + cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( resource_group_name=resource_group_name, @@ -812,9 +824,9 @@ def _update_dns_servers_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 ) @@ -833,7 +845,9 @@ def _update_dns_servers_initial( return deserialized - _update_dns_servers_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + _update_dns_servers_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } @distributed_trace def begin_update_dns_servers( @@ -864,15 +878,15 @@ def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateVirtualClusterDnsServersOperation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( # type: ignore + raw_result = self._update_dns_servers_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, api_version=api_version, @@ -890,7 +904,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: @@ -902,6 +916,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_dns_servers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + begin_update_dns_servers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py index 0e483d29dbc8..f7130dafe2bf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py @@ -48,9 +48,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -82,10 +82,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -222,10 +222,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] + ) + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -238,9 +238,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 ) @@ -257,7 +257,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } def _create_or_update_initial( self, @@ -278,11 +280,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualNetworkRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -306,9 +308,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 ) @@ -330,7 +332,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @overload def begin_create_or_update( @@ -450,16 +454,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] - 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.VirtualNetworkRule] = 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, server_name=server_name, virtual_network_rule_name=virtual_network_rule_name, @@ -480,7 +484,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: @@ -492,9 +496,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -510,10 +516,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -526,9 +532,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 ) @@ -541,7 +547,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def begin_delete( @@ -571,13 +579,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -596,7 +604,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: @@ -608,9 +616,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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def list_by_server( @@ -631,10 +641,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRuleListResult] + ) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -657,12 +667,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -670,13 +680,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("VirtualNetworkRuleListResult", 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 @@ -689,4 +699,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py index 64be5bdf1318..f864ea12572c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py @@ -54,9 +54,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -96,10 +96,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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,9 +140,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -157,7 +157,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -176,9 +176,9 @@ def build_list_by_workload_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +194,7 @@ def build_list_by_workload_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -264,10 +264,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] + ) + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -282,9 +282,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 ) @@ -301,7 +301,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } def _create_or_update_initial( self, @@ -324,11 +326,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadClassifier]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -354,9 +356,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 ) @@ -378,7 +380,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @overload def begin_create_or_update( @@ -522,16 +526,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] - 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.WorkloadClassifier] = 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, server_name=server_name, database_name=database_name, @@ -554,7 +558,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: @@ -566,9 +570,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -590,10 +596,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -608,9 +614,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 ) @@ -623,7 +629,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def begin_delete( @@ -664,13 +672,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -691,7 +699,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: @@ -703,9 +711,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def list_by_workload_group( @@ -731,10 +741,10 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifierListResult] + ) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -759,12 +769,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -772,13 +782,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("WorkloadClassifierListResult", 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 @@ -791,4 +801,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_workload_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers"} # type: ignore + list_by_workload_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py index 8156c89fa8c1..18a0345c0140 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py @@ -53,9 +53,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -93,10 +93,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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 @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -135,9 +135,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -165,9 +165,9 @@ def build_list_by_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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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") @@ -243,10 +243,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] + ) + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,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 ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } def _create_or_update_initial( self, @@ -301,11 +303,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -330,9 +332,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 ) @@ -354,7 +356,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @overload def begin_create_or_update( @@ -483,16 +487,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] - 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.WorkloadGroup] = 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, server_name=server_name, database_name=database_name, @@ -514,7 +518,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: @@ -526,9 +530,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -544,10 +550,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["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -561,9 +567,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 ) @@ -576,7 +582,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def begin_delete( @@ -608,13 +616,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-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, @@ -634,7 +642,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: @@ -646,9 +654,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.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def list_by_database( @@ -671,10 +681,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroupListResult] + ) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -698,12 +708,12 @@ 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: request = HttpRequest("GET", next_link) 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 @@ -711,13 +721,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("WorkloadGroupListResult", 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 @@ -730,4 +740,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py b/sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py deleted file mode 100644 index 15bf29bafe8f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python acquire_managed_server_dns_alias..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_dns_aliases.begin_acquire( - resource_group_name="Default", - managed_instance_name="new-mi", - dns_alias_name="dns-alias-mi", - parameters={ - "oldManagedServerDnsAliasResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/old-mi/dnsAliases/alias1" - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasAcquire.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py deleted file mode 100644 index 77ffce668fe7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python acquire_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dns_aliases.begin_acquire( - resource_group_name="Default", - server_name="dns-alias-new-server", - dns_alias_name="dns-alias-name-1", - parameters={ - "oldServerDnsAliasId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-old-server/dnsAliases/dns-alias-name-1" - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py b/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py deleted file mode 100644 index fd0e993150e1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_baselines.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - baseline_name="default", - parameters={"properties": {"latestScan": True, "results": {}}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py b/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py deleted file mode 100644 index e5fbd295fac8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python add_a_database's_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_baselines.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - baseline_name="default", - parameters={ - "properties": { - "latestScan": False, - "results": { - "VA2063": [["AllowAll", "0.0.0.0", "255.255.255.255"]], - "VA2065": [["AllowAll", "0.0.0.0", "255.255.255.255"]], - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py new file mode 100644 index 000000000000..75b0a5eb2b1e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python administrator_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_administrators.begin_create_or_update( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + administrator_name="ActiveDirectory", + parameters={ + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py new file mode 100644 index 000000000000..20c07d4455c7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python administrator_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_administrators.begin_delete( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + administrator_name="ActiveDirectory", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py new file mode 100644 index 000000000000..e4fd018baeee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python administrator_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_administrators.get( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + administrator_name="ActiveDirectory", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py new file mode 100644 index 000000000000..8dd3b268055b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python administrator_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_administrators.list_by_server( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py deleted file mode 100644 index 4e2474a2fb8c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python approve_or_reject_a_private_endpoint_connection_with_a_given_name..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_endpoint_connections.begin_create_or_update( - resource_group_name="Default", - managed_instance_name="test-cl", - private_endpoint_connection_name="private-endpoint-connection-name", - parameters={ - "properties": { - "privateLinkServiceConnectionState": { - "description": "Approved by johndoe@contoso.com", - "status": "Approved", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_configuration_to_an_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_configuration_to_an_elastic_pool..py deleted file mode 100644 index f581f43deafa..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_configuration_to_an_elastic_pool..py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python assigns_maintenance_configuration_to_an_elastic_pool..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py deleted file mode 100644 index f61dd2395c34..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python assigns_maintenance_window_to_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1" - }, - "sku": {"name": "BC_Gen5_4"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py new file mode 100644 index 000000000000..514cd752b553 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python azure_ad_only_auth_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_only_authentications.begin_create_or_update( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + parameters={"properties": {"azureADOnlyAuthentication": False}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py new file mode 100644 index 000000000000..76a4c845ea88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python azure_ad_only_auth_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_only_authentications.begin_delete( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py new file mode 100644 index 000000000000..5ae544803c4e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python azure_ad_only_auth_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_only_authentications.get( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py new file mode 100644 index 000000000000..a620d1ae9888 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python azure_ad_only_auth_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_only_authentications.list_by_server( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py deleted file mode 100644 index 28a50b7e5cbb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancel_a_job_execution..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.cancel( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py deleted file mode 100644 index 9401d180a592..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancel_a_sync_group_synchronization.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.cancel_sync( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py new file mode 100644 index 000000000000..c4b92f07ce5c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python cancel_database_operation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_operations.cancel( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-6661", + database_name="testdb", + operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py new file mode 100644 index 000000000000..86d93b9c65ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python cancel_elastic_pool_operation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pool_operations.cancel( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-6661", + elastic_pool_name="testpool", + operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py new file mode 100644 index 000000000000..26e74b0f2893 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python cancel_job_execution.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.cancel( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py new file mode 100644 index 000000000000..54cf628ff8b4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python cancel_managed_instance_operation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_operations.cancel( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + operation_id="11111111-1111-1111-1111-111111111111", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py deleted file mode 100644 index 85e75005eb7c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancel_the_database_management_operation.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_operations.cancel( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-6661", - database_name="testdb", - operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py deleted file mode 100644 index 60ff1f895bcf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancel_the_elastic_pool_management_operation.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pool_operations.cancel( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-6661", - elastic_pool_name="testpool", - operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py deleted file mode 100644 index 6c35d9de3157..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancel_the_managed_instance_management_operation.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_operations.cancel( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - operation_id="11111111-1111-1111-1111-111111111111", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py b/sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py deleted file mode 100644 index bfc9e4fe4b6e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python cancels_a_managed_database_move..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_cancel_move( - resource_group_name="group1", - managed_instance_name="testInstanceSrc", - database_name="testDatabase", - parameters={ - "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCancelMove.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py deleted file mode 100644 index b14ad17cd0af..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python check_for_a_server_name_that_already_exists.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.check_name_availability( - parameters={"name": "server1", "type": "Microsoft.Sql/servers"}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py deleted file mode 100644 index 60e6d634c73b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python check_for_a_server_name_that_is_available.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.check_name_availability( - parameters={"name": "server1", "type": "Microsoft.Sql/servers"}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAvailable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py deleted file mode 100644 index 42210c149423..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python check_for_a_server_name_that_is_invalid.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.check_name_availability( - parameters={"name": "SERVER1", "type": "Microsoft.Sql/servers"}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerInvalid.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py new file mode 100644 index 000000000000..a283e5dcb908 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py @@ -0,0 +1,40 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python check_name_availability_server_already_exists.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.check_name_availability( + parameters={"name": "server1", "type": "Microsoft.Sql/servers"}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py new file mode 100644 index 000000000000..60d7a5e2b27c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py @@ -0,0 +1,40 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python check_name_availability_server_available.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.check_name_availability( + parameters={"name": "server1", "type": "Microsoft.Sql/servers"}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAvailable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py new file mode 100644 index 000000000000..437eedb54a1f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py @@ -0,0 +1,40 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python check_name_availability_server_invalid.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.check_name_availability( + parameters={"name": "SERVER1", "type": "Microsoft.Sql/servers"}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerInvalid.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py new file mode 100644 index 000000000000..7f4740c0b4f4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python column_sensitivity_label_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.create_or_update( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + parameters={ + "properties": { + "informationType": "PhoneNumber", + "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", + "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", + "labelName": "PII", + "rank": "Low", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py new file mode 100644 index 000000000000..1e6905b0c786 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python column_sensitivity_label_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.delete( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py new file mode 100644 index 000000000000..b03bde7daa70 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python column_sensitivity_label_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.get( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + sensitivity_label_source="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py new file mode 100644 index 000000000000..621ef01993d5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python columns_list_by_database_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_columns.list_by_database( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py new file mode 100644 index 000000000000..4c4ef960ce8a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python columns_list_by_database_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_columns.list_by_database( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py b/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py deleted file mode 100644 index 8414d9e5157f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python completes_a_managed_database_external_backup_restore..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_complete_restore( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - parameters={"lastBackupName": "testdb1_log4"}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py b/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py deleted file mode 100644 index cba693320c43..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python completes_a_managed_database_move..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_complete_move( - resource_group_name="group1", - managed_instance_name="testInstanceSrc", - database_name="testDatabase", - parameters={ - "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCompleteMove.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py deleted file mode 100644 index 8371069b38ac..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python copy_the_long_term_retention_backup..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.begin_copy( - location_name="japaneast", - long_term_retention_server_name="testserver", - long_term_retention_database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", - parameters={ - "properties": { - "targetBackupStorageRedundancy": "Geo", - "targetDatabaseName": "testDatabase2", - "targetServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py deleted file mode 100644 index 2a1dce31dcdc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create/_update_data_masking_rule_for_default_max.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_rules.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - data_masking_rule_name="rule1", - parameters={ - "properties": { - "aliasName": "nickname", - "columnName": "test1", - "maskingFunction": "Default", - "ruleState": "Enabled", - "schemaName": "dbo", - "tableName": "Table_1", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py deleted file mode 100644 index 65df1f4c3aa5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create/_update_data_masking_rule_for_default_min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_rules.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - data_masking_rule_name="rule1", - parameters={ - "properties": { - "columnName": "test1", - "maskingFunction": "Default", - "schemaName": "dbo", - "tableName": "Table_1", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py b/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py deleted file mode 100644 index 786b2ceef87c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create/_update_data_masking_rule_for_numbers.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_rules.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - data_masking_rule_name="rule1", - parameters={ - "properties": { - "columnName": "test1", - "maskingFunction": "Number", - "numberFrom": "0", - "numberTo": "2", - "schemaName": "dbo", - "tableName": "Table_1", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py b/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py deleted file mode 100644 index b3e385313e4e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create/_update_data_masking_rule_for_text.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_rules.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - data_masking_rule_name="rule1", - parameters={ - "properties": { - "columnName": "test1", - "maskingFunction": "Text", - "prefixSize": "1", - "replacementString": "asdf", - "schemaName": "dbo", - "suffixSize": "0", - "tableName": "Table_1", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py deleted file mode 100644 index 8b8bda67437a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_database's_vulnerability_assessment_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "recurringScans": { - "emailSubscriptionAdmins": True, - "emails": ["email1@mail.com", "email2@mail.com"], - "isEnabled": True, - }, - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py deleted file mode 100644 index 54e34cc11b0f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py deleted file mode 100644 index 3304b11f33e5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py deleted file mode 100644 index b265c472df43..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py deleted file mode 100644 index d35644aaa2f4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_distributed_availability_group..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.distributed_availability_groups.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - parameters={ - "properties": { - "primaryAvailabilityGroupName": "BoxLocalAg1", - "secondaryAvailabilityGroupName": "testcl", - "sourceEndpoint": "TCP://SERVER:7022", - "targetDatabase": "testdb", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py deleted file mode 100644 index 4ac40cbc363a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_firewall_rule_max/min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.create_or_update( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-5370", - parameters={"properties": {"endIpAddress": "0.0.0.3", "startIpAddress": "0.0.0.3"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py deleted file mode 100644 index b38725304e76..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_job_with_all_properties_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.jobs.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - parameters={ - "properties": { - "description": "my favourite job", - "schedule": { - "enabled": True, - "endTime": "2015-09-24T23:59:59Z", - "interval": "PT5M", - "startTime": "2015-09-24T18:30:01Z", - "type": "Recurring", - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py deleted file mode 100644 index fd118bc65549..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_managed_instance's_vulnerability_assessment_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "recurringScans": { - "emailSubscriptionAdmins": True, - "emails": ["email1@mail.com", "email2@mail.com"], - "isEnabled": True, - }, - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py deleted file mode 100644 index 41637d26ee30..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py deleted file mode 100644 index c255bb8cfff6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py deleted file mode 100644 index ccf7f2c2bb00..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_new_sync_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.begin_create_or_update( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - parameters={ - "properties": { - "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py deleted file mode 100644 index 5c6dc0109c60..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_new_sync_member.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.begin_create_or_update( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncmembercrud-4879", - parameters={ - "properties": { - "databaseName": "syncgroupcrud-7421", - "databaseType": "AzureSqlDatabase", - "serverName": "syncgroupcrud-3379.database.windows.net", - "syncDirection": "Bidirectional", - "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", - "usePrivateLinkConnection": True, - "userName": "myUser", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py deleted file mode 100644 index 08e95112edae..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_server's_vulnerability_assessment_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "recurringScans": { - "emailSubscriptionAdmins": True, - "emails": ["email1@mail.com", "email2@mail.com"], - "isEnabled": True, - }, - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py deleted file mode 100644 index 044af8dcea69..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py deleted file mode 100644 index 984d77d3364f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={ - "properties": { - "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", - "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py deleted file mode 100644 index cff1294e7d89..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_server_communication_link.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_communication_links.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - communication_link_name="link1", - parameters={"properties": {"partnerServer": "sqldcrudtest-test"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py deleted file mode 100644 index 493510b98201..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_sql_vulnerability_assessment_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessments_settings.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py deleted file mode 100644 index 952e819d3cb3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_sync_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.begin_create_or_update( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - parameters={ - "properties": { - "conflictResolutionPolicy": "HubWin", - "hubDatabaseUserName": "hubUser", - "interval": -1, - "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", - "usePrivateLinkConnection": True, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py deleted file mode 100644 index 4861744ff6ba..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_workload_group_with_all_properties_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_classifiers.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - workload_classifier_name="wlm_workloadclassifier", - parameters={ - "properties": { - "context": "test_context", - "endTime": "14:00", - "importance": "high", - "label": "test_label", - "memberName": "dbo", - "startTime": "12:00", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py deleted file mode 100644 index 34696477b83c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_a_workload_group_with_the_required_properties_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_classifiers.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - workload_classifier_name="wlm_workloadclassifier", - parameters={"properties": {"memberName": "dbo"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py deleted file mode 100644 index f781195a126e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_administrator_of_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_administrators.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - administrator_name="ActiveDirectory", - parameters={ - "properties": { - "administratorType": "ActiveDirectory", - "login": "bob@contoso.com", - "sid": "44444444-3333-2222-1111-000000000000", - "tenantId": "55555555-4444-3333-2222-111111111111", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py deleted file mode 100644 index f66ce1f7f3c2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_an_instance_pool_with_all_properties..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.begin_create_or_update( - resource_group_name="group1", - instance_pool_name="testIP", - parameters={ - "location": "japaneast", - "properties": { - "licenseType": "LicenseIncluded", - "subnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1", - "vCores": 8, - }, - "sku": {"family": "Gen5", "name": "GP_Gen5", "tier": "GeneralPurpose"}, - "tags": {"a": "b"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py deleted file mode 100644 index 3bc69b19802e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_an_instance_pool_with_min_properties..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.begin_create_or_update( - resource_group_name="group1", - instance_pool_name="testIP", - parameters={ - "location": "japaneast", - "properties": { - "licenseType": "LicenseIncluded", - "subnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1", - "vCores": 8, - }, - "sku": {"family": "Gen5", "name": "GP_Gen5", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py deleted file mode 100644 index eeeff85f2959..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_an_ipv6_firewall_rule_max/min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ipv6_firewall_rules.create_or_update( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-5370", - parameters={ - "properties": { - "endIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0003", - "startIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0003", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py new file mode 100644 index 000000000000..776be65d2087 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_configured_backup_storage_redundancy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "properties": {"requestedBackupStorageRedundancy": "Zone"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py new file mode 100644 index 000000000000..cf6a37a38f70 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_copy_mode.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="dbcopy", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Copy", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb", + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseCopyMode.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py new file mode 100644 index 000000000000..7fe7ab0bc489 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_default_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "properties": {"preferredEnclaveType": "Default"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseDefaultEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py new file mode 100644 index 000000000000..9fca87c06715 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_default_mode.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "location": "southeastasia", + "properties": { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "Default", + "maxSizeBytes": 1073741824, + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseDefaultMode.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py new file mode 100644 index 000000000000..eaae7fb5a1b3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_ledger.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "properties": {"isLedgerOn": True}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseLedger.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py new file mode 100644 index 000000000000..3256d82643fd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py @@ -0,0 +1,52 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "location": "southeastasia", + "properties": { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "Default", + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1", + "maxSizeBytes": 1073741824, + }, + "sku": {"name": "S2", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py new file mode 100644 index 000000000000..9c66a520b2a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia"}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py new file mode 100644 index 000000000000..9b4f9758023c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_named_replica.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Secondary", + "secondaryType": "Named", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb", + }, + "sku": {"capacity": 2, "name": "HS_Gen4", "tier": "Hyperscale"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseNamedReplica.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py new file mode 100644 index 000000000000..88b4fc545e82 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_pitr_mode.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="dbpitr", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "PointInTimeRestore", + "restorePointInTime": "2020-10-22T05:35:31.503Z", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabasePITRMode.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py new file mode 100644 index 000000000000..42e8b1cdd70a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_secondary_mode.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Secondary", + "secondaryType": "Geo", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb", + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseSecondaryMode.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py new file mode 100644 index 000000000000..a270469d50f6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_standby_mode.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Secondary", + "secondaryType": "Standby", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb", + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseStandbyMode.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py new file mode 100644 index 000000000000..8daa04b83bb1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_database_vbs_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "properties": {"preferredEnclaveType": "VBS"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py new file mode 100644 index 000000000000..b409d6b8172b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_dw_database_cross_subscription_pitr.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdw", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "PointInTimeRestore", + "restorePointInTime": "2022-01-22T05:35:31.503Z", + "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py new file mode 100644 index 000000000000..a384ba708ff5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_dw_database_cross_subscription_recovery.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-WestUS", + server_name="testsvr", + database_name="testdw", + parameters={ + "location": "westus", + "properties": { + "createMode": "Recovery", + "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py new file mode 100644 index 000000000000..c80d67d8df46 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_dw_database_cross_subscription_restore.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdw", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Restore", + "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py deleted file mode 100644 index 2e1c34153506..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.begin_create_or_update( - resource_group_name="Default", - server_name="failover-group-primary-server", - failover_group_name="failover-group-test-3", - parameters={ - "properties": { - "databases": [ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1", - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2", - ], - "partnerServers": [ - { - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server" - } - ], - "readOnlyEndpoint": {"failoverPolicy": "Disabled"}, - "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 480}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py deleted file mode 100644 index 687c40dff430..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_job_execution..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.begin_create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py new file mode 100644 index 000000000000..140cae942888 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_job_execution.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.begin_create( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py deleted file mode 100644 index 6b69791cf7e0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py +++ /dev/null @@ -1,71 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_managed_instance_with_all_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - parameters={ - "location": "Japan East", - "properties": { - "administratorLogin": "dummylogin", - "administratorLoginPassword": "PLACEHOLDER", - "administrators": { - "azureADOnlyAuthentication": True, - "login": "bob@contoso.com", - "principalType": "User", - "sid": "00000011-1111-2222-2222-123456789111", - "tenantId": "00000011-1111-2222-2222-123456789111", - }, - "collation": "SQL_Latin1_General_CP1_CI_AS", - "dnsZonePartner": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance", - "instancePoolId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1", - "licenseType": "LicenseIncluded", - "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", - "minimalTlsVersion": "1.2", - "proxyOverride": "Redirect", - "publicDataEndpointEnabled": False, - "requestedBackupStorageRedundancy": "Geo", - "servicePrincipal": {"type": "SystemAssigned"}, - "storageSizeInGB": 1024, - "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "timezoneId": "UTC", - "vCores": 8, - }, - "sku": {"name": "GP_Gen5", "tier": "GeneralPurpose"}, - "tags": {"tagKey1": "TagValue1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py deleted file mode 100644 index 24c376cc3cde..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_managed_instance_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - parameters={ - "location": "Japan East", - "properties": { - "administratorLogin": "dummylogin", - "administratorLoginPassword": "PLACEHOLDER", - "licenseType": "LicenseIncluded", - "storageSizeInGB": 1024, - "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "vCores": 8, - }, - "sku": {"name": "GP_Gen4", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py deleted file mode 100644 index e6d29846e86c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_credential.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_credentials.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - credential_name="cred1", - parameters={"properties": {"password": "", "username": "myuser"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index 019675b3e998..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py deleted file mode 100644 index 50a4d09fe861..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_database's_blob_auditing_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={ - "properties": { - "auditActionsAndGroups": [ - "DATABASE_LOGOUT_GROUP", - "DATABASE_ROLE_MEMBER_CHANGE_GROUP", - "UPDATE on database::TestDatabaseName by public", - ], - "isAzureMonitorTargetEnabled": True, - "isStorageSecondaryKeyInUse": False, - "queueDelayMs": 4000, - "retentionDays": 6, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index 28e77e66be1e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={ - "properties": { - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py deleted file mode 100644 index 1c911de35425..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_job_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_agents.begin_create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - parameters={ - "location": "southeastasia", - "properties": { - "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1" - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py deleted file mode 100644 index 423a45674431..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py +++ /dev/null @@ -1,69 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_job_step_with_all_properties_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - step_name="step1", - parameters={ - "properties": { - "action": {"source": "Inline", "type": "TSql", "value": "select 2"}, - "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1", - "executionOptions": { - "initialRetryIntervalSeconds": 11, - "maximumRetryIntervalSeconds": 222, - "retryAttempts": 42, - "retryIntervalBackoffMultiplier": 3, - "timeoutSeconds": 1234, - }, - "output": { - "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0", - "databaseName": "database3", - "resourceGroupName": "group3", - "schemaName": "myschema1234", - "serverName": "server3", - "subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a", - "tableName": "mytable5678", - "type": "SqlDatabase", - }, - "stepId": 1, - "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py deleted file mode 100644 index 86fa3bed198d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_job_step_with_minimal_properties_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - step_name="step1", - parameters={ - "properties": { - "action": {"value": "select 1"}, - "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0", - "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py deleted file mode 100644 index 91676e87059e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py +++ /dev/null @@ -1,75 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_target_group_with_all_properties..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_groups.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - target_group_name="targetGroup1", - parameters={ - "properties": { - "members": [ - { - "databaseName": "database1", - "membershipType": "Exclude", - "serverName": "server1", - "type": "SqlDatabase", - }, - { - "membershipType": "Include", - "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", - "serverName": "server1", - "type": "SqlServer", - }, - { - "elasticPoolName": "pool1", - "membershipType": "Include", - "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", - "serverName": "server2", - "type": "SqlElasticPool", - }, - { - "membershipType": "Include", - "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", - "serverName": "server3", - "shardMapName": "shardMap1", - "type": "SqlShardMap", - }, - ] - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py deleted file mode 100644 index 4fa4adc30b60..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_target_group_with_minimal_properties..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_groups.create_or_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - target_group_name="targetGroup1", - parameters={"properties": {"members": []}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py deleted file mode 100644 index 6050075e3017..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_a_virtual_network_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.virtual_network_rules.begin_create_or_update( - resource_group_name="Default", - server_name="vnet-test-svr", - virtual_network_rule_name="vnet-firewall-rule", - parameters={ - "properties": { - "ignoreMissingVnetServiceEndpoint": False, - "virtualNetworkSubnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index 9e1ee67c4c6b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py deleted file mode 100644 index 55c01023aeff..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={ - "properties": { - "auditActionsAndGroups": [ - "DATABASE_LOGOUT_GROUP", - "DATABASE_ROLE_MEMBER_CHANGE_GROUP", - "UPDATE on database::TestDatabaseName by public", - ], - "isAzureMonitorTargetEnabled": True, - "isStorageSecondaryKeyInUse": False, - "predicateExpression": "statement = 'select 1'", - "queueDelayMs": 4000, - "retentionDays": 6, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index ebc6e28f47d1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_database_blob_auditing_policies.create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - database_name="testdb", - parameters={ - "properties": { - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py deleted file mode 100644 index 43934cd20cbf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_data_masking_policy_max.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_policies.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - parameters={"properties": {"dataMaskingState": "Enabled", "exemptPrincipals": "testuser;"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py deleted file mode 100644 index 74009b96afde..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_data_masking_policy_min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_policies.create_or_update( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - parameters={"properties": {"dataMaskingState": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions..py deleted file mode 100644 index 643efb7fcdc2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_database_extensions..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="a1c0814d-3c18-4e1e-a247-c128c12b1677", - ) - - response = client.database_extensions.begin_create_or_update( - resource_group_name="rg_20cbe0f0-c2d9-4522-9177-5469aad53029", - server_name="srv_1ffd1cf8-9951-47fb-807d-a9c384763849", - database_name="878e303f-1ea0-4f17-aa3d-a22ac5e9da08", - extension_name="polybaseimport", - parameters={ - "properties": { - "operationMode": "PolybaseImport", - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py new file mode 100644 index 000000000000..d45e2fd3a92d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_database_extensions.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="a1c0814d-3c18-4e1e-a247-c128c12b1677", + ) + + response = client.database_extensions.begin_create_or_update( + resource_group_name="rg_20cbe0f0-c2d9-4522-9177-5469aad53029", + server_name="srv_1ffd1cf8-9951-47fb-807d-a9c384763849", + database_name="878e303f-1ea0-4f17-aa3d-a22ac5e9da08", + extension_name="polybaseimport", + parameters={ + "properties": { + "operationMode": "PolybaseImport", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py deleted file mode 100644 index 88badd877eeb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_elastic_pool_with_all_parameter.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_create_or_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "location": "Japan East", - "properties": {"perDatabaseSettings": {"maxCapacity": 2, "minCapacity": 0.25}}, - "sku": {"capacity": 2, "name": "GP_Gen4_2", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py deleted file mode 100644 index 8794dcc188c5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_elastic_pool_with_maintenance_configuration_parameter.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_create_or_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "location": "Japan East", - "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1" - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py deleted file mode 100644 index 3a48bb094b73..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_elastic_pool_with_minimum_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_create_or_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={"location": "Japan East"}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py deleted file mode 100644 index 5835b85251d4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_create_or_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "location": "Japan East", - "properties": {"highAvailabilityReplicaCount": 2}, - "sku": {"name": "HS_Gen5_4"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py new file mode 100644 index 000000000000..588367a4b077 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_instance_pool_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.begin_create_or_update( + resource_group_name="group1", + instance_pool_name="testIP", + parameters={ + "location": "japaneast", + "properties": { + "licenseType": "LicenseIncluded", + "subnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1", + "vCores": 8, + }, + "sku": {"family": "Gen5", "name": "GP_Gen5", "tier": "GeneralPurpose"}, + "tags": {"a": "b"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py new file mode 100644 index 000000000000..952d96b98136 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_instance_pool_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.begin_create_or_update( + resource_group_name="group1", + instance_pool_name="testIP", + parameters={ + "location": "japaneast", + "properties": { + "licenseType": "LicenseIncluded", + "subnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1", + "vCores": 8, + }, + "sku": {"family": "Gen5", "name": "GP_Gen5", "tier": "GeneralPurpose"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py new file mode 100644 index 000000000000..f066e0b16e8b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_agents.begin_create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + parameters={ + "location": "southeastasia", + "properties": { + "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1" + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py new file mode 100644 index 000000000000..4138903a7b1f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_credential.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_credentials.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + credential_name="cred1", + parameters={"properties": {"password": "", "username": "myuser"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py new file mode 100644 index 000000000000..e9838af25e90 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_execution.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.begin_create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py new file mode 100644 index 000000000000..aecc978f14d7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.jobs.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + parameters={ + "properties": { + "description": "my favourite job", + "schedule": { + "enabled": True, + "endTime": "2015-09-24T23:59:59Z", + "interval": "PT5M", + "startTime": "2015-09-24T18:30:01Z", + "type": "Recurring", + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py new file mode 100644 index 000000000000..7c9648df36f1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py @@ -0,0 +1,69 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_step_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + step_name="step1", + parameters={ + "properties": { + "action": {"source": "Inline", "type": "TSql", "value": "select 2"}, + "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1", + "executionOptions": { + "initialRetryIntervalSeconds": 11, + "maximumRetryIntervalSeconds": 222, + "retryAttempts": 42, + "retryIntervalBackoffMultiplier": 3, + "timeoutSeconds": 1234, + }, + "output": { + "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0", + "databaseName": "database3", + "resourceGroupName": "group3", + "schemaName": "myschema1234", + "serverName": "server3", + "subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a", + "tableName": "mytable5678", + "type": "SqlDatabase", + }, + "stepId": 1, + "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py new file mode 100644 index 000000000000..de2a5fce51c5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_step_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + step_name="step1", + parameters={ + "properties": { + "action": {"value": "select 1"}, + "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0", + "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py new file mode 100644 index 000000000000..e8448ddf295a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py @@ -0,0 +1,75 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_target_group_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_groups.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + target_group_name="targetGroup1", + parameters={ + "properties": { + "members": [ + { + "databaseName": "database1", + "membershipType": "Exclude", + "serverName": "server1", + "type": "SqlDatabase", + }, + { + "membershipType": "Include", + "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", + "serverName": "server1", + "type": "SqlServer", + }, + { + "elasticPoolName": "pool1", + "membershipType": "Include", + "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", + "serverName": "server2", + "type": "SqlElasticPool", + }, + { + "membershipType": "Include", + "refreshCredential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential", + "serverName": "server3", + "shardMapName": "shardMap1", + "type": "SqlShardMap", + }, + ] + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py new file mode 100644 index 000000000000..ec6451e2d78a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_job_target_group_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_groups.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + target_group_name="targetGroup1", + parameters={"properties": {"members": []}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py new file mode 100644 index 000000000000..336f934359c1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_maintenance_windows.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.maintenance_windows.create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdwdb", + maintenance_window_name="current", + parameters={ + "properties": {"timeRanges": [{"dayOfWeek": "Saturday", "duration": "PT60M", "startTime": "00:00:00"}]} + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py deleted file mode 100644 index e4b11fefd84e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_the_long_term_retention_policy_for_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_policies.begin_create_or_update( - resource_group_name="resourceGroup", - server_name="testserver", - database_name="testDatabase", - policy_name="default", - parameters={ - "properties": { - "monthlyRetention": "P1Y", - "weekOfYear": 5, - "weeklyRetention": "P1M", - "yearlyRetention": "P5Y", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py deleted file mode 100644 index efedcfbcedf1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_or_update_the_ltr_policy_for_the_managed_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_long_term_retention_policies.begin_create_or_update( - resource_group_name="testResourceGroup", - managed_instance_name="testInstance", - database_name="testDatabase", - policy_name="default", - parameters={ - "properties": { - "monthlyRetention": "P1Y", - "weekOfYear": 5, - "weeklyRetention": "P1M", - "yearlyRetention": "P5Y", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py new file mode 100644 index 000000000000..8cd1a27f308a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_workload_classifier_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_classifiers.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + workload_classifier_name="wlm_workloadclassifier", + parameters={ + "properties": { + "context": "test_context", + "endTime": "14:00", + "importance": "high", + "label": "test_label", + "memberName": "dbo", + "startTime": "12:00", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py new file mode 100644 index 000000000000..821c37e5302d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_workload_classifier_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_classifiers.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + workload_classifier_name="wlm_workloadclassifier", + parameters={"properties": {"memberName": "dbo"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py new file mode 100644 index 000000000000..a14154818b23 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_workload_group_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_groups.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="smallrc", + parameters={ + "properties": { + "importance": "normal", + "maxResourcePercent": 100, + "maxResourcePercentPerRequest": 3, + "minResourcePercent": 0, + "minResourcePercentPerRequest": 3, + "queryExecutionTimeout": 0, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py new file mode 100644 index 000000000000..60c8eb07ec8d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_or_update_workload_group_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_groups.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="smallrc", + parameters={ + "properties": {"maxResourcePercent": 100, "minResourcePercent": 0, "minResourcePercentPerRequest": 3} + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_server.py deleted file mode 100644 index 148c2848b12b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - parameters={ - "location": "Japan East", - "properties": { - "administratorLogin": "dummylogin", - "administratorLoginPassword": "PLACEHOLDER", - "administrators": { - "azureADOnlyAuthentication": True, - "login": "bob@contoso.com", - "principalType": "User", - "sid": "00000011-1111-2222-2222-123456789111", - "tenantId": "00000011-1111-2222-2222-123456789111", - }, - "publicNetworkAccess": "Enabled", - "restrictOutboundNetworkAccess": "Enabled", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py deleted file mode 100644 index e30463a2af5c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dns_aliases.begin_create_or_update( - resource_group_name="Default", - server_name="dns-alias-server", - dns_alias_name="dns-alias-name-1", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py deleted file mode 100644 index b639823482f1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_server_trust_certificate..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="0574222d-5c7f-489c-a172-b3013eafab53", - ) - - response = client.server_trust_certificates.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testcl", - certificate_name="customerCertificateName", - parameters={"properties": {"publicBlob": "308203AE30820296A0030201020210"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py deleted file mode 100644 index 955ae821e83f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python create_server_trust_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_trust_groups.begin_create_or_update( - resource_group_name="Default", - location_name="Japan East", - server_trust_group_name="server-trust-group-test", - parameters={ - "properties": { - "groupMembers": [ - { - "serverId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1" - }, - { - "serverId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2" - }, - ], - "trustScopes": ["GlobalTransactions", "ServiceBroker"], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py new file mode 100644 index 000000000000..64b69569b15a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_vcore_database_by_service_objective.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "sku": {"capacity": 2, "family": "Gen4", "name": "BC"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py new file mode 100644 index 000000000000..dad309baea08 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_vcore_database_by_sku_name_capacity.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"location": "southeastasia", "sku": {"capacity": 2, "name": "BC_Gen4"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py deleted file mode 100644 index c89af497538b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdw", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Restore", - "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py deleted file mode 100644 index 99677ff02201..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-WestUS", - server_name="testsvr", - database_name="testdw", - parameters={ - "location": "westus", - "properties": { - "createMode": "Recovery", - "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py deleted file mode 100644 index 385dcf705b8f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdw", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "PointInTimeRestore", - "restorePointInTime": "2022-01-22T05:35:31.503Z", - "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py deleted file mode 100644 index d1355fe8fd07..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_as_a_copy..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="dbcopy", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Copy", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb", - }, - "sku": {"name": "S0", "tier": "Standard"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseCopyMode.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py deleted file mode 100644 index 105f92dbf23a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_as_a_standby_secondary..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Secondary", - "secondaryType": "Standby", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb", - }, - "sku": {"name": "S0", "tier": "Standard"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseStandbyMode.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py deleted file mode 100644 index d6354f3c976e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_as_an_online_secondary..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Secondary", - "secondaryType": "Geo", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb", - }, - "sku": {"name": "S0", "tier": "Standard"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseSecondaryMode.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py deleted file mode 100644 index 4a26bd681bc5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_as_named_replica_secondary..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Secondary", - "secondaryType": "Named", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb", - }, - "sku": {"capacity": 2, "name": "HS_Gen4", "tier": "Hyperscale"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseNamedReplica.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py deleted file mode 100644 index 0d7afae35835..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_from_point_in_time_restore..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="dbpitr", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "PointInTimeRestore", - "restorePointInTime": "2020-10-22T05:35:31.503Z", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabasePITRMode.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py deleted file mode 100644 index de01fb1ca4f6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_with_default_mode..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "location": "southeastasia", - "properties": { - "collation": "SQL_Latin1_General_CP1_CI_AS", - "createMode": "Default", - "maxSizeBytes": 1073741824, - }, - "sku": {"name": "S0", "tier": "Standard"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseDefaultMode.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py deleted file mode 100644 index 2899cb211bf9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_with_ledger_on..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={"location": "southeastasia", "properties": {"isLedgerOn": True}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseLedger.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py deleted file mode 100644 index b0c1b8915f1e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_with_minimum_number_of_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={"location": "southeastasia"}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py deleted file mode 100644 index d238b588f620..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_with_preferred_maintenance_window..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "location": "southeastasia", - "properties": { - "collation": "SQL_Latin1_General_CP1_CI_AS", - "createMode": "Default", - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1", - "maxSizeBytes": 1073741824, - }, - "sku": {"name": "S2", "tier": "Standard"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py deleted file mode 100644 index 92f7ecfd2bfb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_database_with_specified_backup_storage_redundancy..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={"location": "southeastasia", "properties": {"requestedBackupStorageRedundancy": "Zone"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py deleted file mode 100644 index f673918f6fa1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_by_restoring_from_an_external_backup.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={ - "location": "southeastasia", - "properties": { - "autoCompleteRestore": True, - "collation": "SQL_Latin1_General_CP1_CI_AS", - "createMode": "RestoreExternalBackup", - "lastBackupName": "last_backup_name", - "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234", - "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py deleted file mode 100644 index fcac92edd8b9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={ - "location": "southeastasia", - "properties": { - "autoCompleteRestore": True, - "collation": "SQL_Latin1_General_CP1_CI_AS", - "createMode": "RestoreExternalBackup", - "lastBackupName": "last_backup_name", - "storageContainerIdentity": "ManagedIdentity", - "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py deleted file mode 100644 index 19b7a51f3eee..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_from_restoring_a_georeplicated_backup.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="server1", - database_name="testdb_recovered", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "Recovery", - "recoverableDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRecovery.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py deleted file mode 100644 index 62ff657efe27..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={ - "location": "southeastasia", - "properties": { - "collation": "SQL_Latin1_General_CP1_CI_AS", - "createMode": "RestoreExternalBackup", - "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234", - "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py deleted file mode 100644 index f6a3a29ab980..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_using_point_in_time_restore.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={ - "location": "southeastasia", - "properties": { - "createMode": "PointInTimeRestore", - "restorePointInTime": "2017-07-14T05:35:31.503Z", - "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py deleted file mode 100644 index b4191faed443..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_with_maximal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={"location": "southeastasia", "tags": {"tagKey1": "TagValue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py deleted file mode 100644 index 6ad1def5af82..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_new_managed_database_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="managedDatabase", - parameters={"location": "southeastasia"}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py deleted file mode 100644 index f6b1f0a4326a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_vcore_database_by_specifying_service_objective_name..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={"location": "southeastasia", "sku": {"capacity": 2, "family": "Gen4", "name": "BC"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py deleted file mode 100644 index b0cf40c1847f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_a_vcore_database_by_specifying_sku_name_and_capacity..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={"location": "southeastasia", "sku": {"capacity": 2, "name": "BC_Gen4"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py deleted file mode 100644 index 44a271294cb1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_datawarehouse_database_restore_point..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.begin_create( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testserver", - database_name="testDatabase", - parameters={"restorePointLabel": "mylabel"}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py deleted file mode 100644 index d588636798ce..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_rule_baselines.create_or_update( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - rule_id="VA1001", - baseline_name="default", - parameters={ - "properties": { - "baselineResults": [ - {"result": ["userA", "SELECT"]}, - {"result": ["userB", "SELECT"]}, - {"result": ["userC", "SELECT", "tableId_4"]}, - ] - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py deleted file mode 100644 index 5bc5dd4d1d5e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_or_updates_a_managed_instance_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_keys.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - parameters={ - "properties": { - "serverKeyType": "AzureKeyVault", - "uri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py deleted file mode 100644 index 6236be5409c9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_or_updates_a_server_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_keys.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - parameters={ - "properties": { - "serverKeyType": "AzureKeyVault", - "uri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py deleted file mode 100644 index fc6bd1982b7d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_or_updates_an_existing_azure_active_directory_administrator..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_azure_ad_administrators.begin_create_or_update( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-6440", - administrator_name="ActiveDirectory", - parameters={ - "properties": { - "administratorType": "ActiveDirectory", - "login": "bob@contoso.com", - "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", - "tenantId": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py deleted file mode 100644 index 16e428d7f233..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python creates_or_updates_azure_active_directory_only_authentication_object..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_azure_ad_only_authentications.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - authentication_name="Default", - parameters={"properties": {"azureADOnlyAuthentication": False}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py new file mode 100644 index 000000000000..ae81b6b823d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_policy_create_or_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_policies.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + parameters={"properties": {"dataMaskingState": "Enabled", "exemptPrincipals": "testuser;"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py new file mode 100644 index 000000000000..e5dc4141c90f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_policy_create_or_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_policies.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + parameters={"properties": {"dataMaskingState": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py new file mode 100644 index 000000000000..9c89c501ac62 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_policy_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_policies.get( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py new file mode 100644 index 000000000000..aeb43781c2ec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_rule_create_or_update_default_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_rules.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + data_masking_rule_name="rule1", + parameters={ + "properties": { + "aliasName": "nickname", + "columnName": "test1", + "maskingFunction": "Default", + "ruleState": "Enabled", + "schemaName": "dbo", + "tableName": "Table_1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py new file mode 100644 index 000000000000..0825719a912b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_rule_create_or_update_default_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_rules.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + data_masking_rule_name="rule1", + parameters={ + "properties": { + "columnName": "test1", + "maskingFunction": "Default", + "schemaName": "dbo", + "tableName": "Table_1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py new file mode 100644 index 000000000000..93e19a5bbce3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_rule_create_or_update_number.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_rules.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + data_masking_rule_name="rule1", + parameters={ + "properties": { + "columnName": "test1", + "maskingFunction": "Number", + "numberFrom": "0", + "numberTo": "2", + "schemaName": "dbo", + "tableName": "Table_1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py new file mode 100644 index 000000000000..3b5529d59021 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_rule_create_or_update_text.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_rules.create_or_update( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + data_masking_rule_name="rule1", + parameters={ + "properties": { + "columnName": "test1", + "maskingFunction": "Text", + "prefixSize": "1", + "replacementString": "asdf", + "schemaName": "dbo", + "suffixSize": "0", + "tableName": "Table_1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py new file mode 100644 index 000000000000..6bb448a9bafc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_masking_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_masking_rules.list_by_database( + resource_group_name="sqlcrudtest-6852", + server_name="sqlcrudtest-2080", + database_name="sqlcrudtest-331", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py new file mode 100644 index 000000000000..819971d9d959 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_warehouse_restore_points_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testserver", + database_name="testDatabase", + restore_point_name="131546477590000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py new file mode 100644 index 000000000000..0f30207f8232 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python data_warehouse_restore_points_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testserver", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py new file mode 100644 index 000000000000..57325df63a9a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advanced_threat_protection_settings_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advanced_threat_protection_settings.create_or_update( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + database_name="testdb", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py new file mode 100644 index 000000000000..3faf0ec380cd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advanced_threat_protection_settings_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advanced_threat_protection_settings.create_or_update( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + database_name="testdb", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Disabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py new file mode 100644 index 000000000000..3a7550b1e6a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advanced_threat_protection_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advanced_threat_protection_settings.get( + resource_group_name="threatprotection-6852", + server_name="threatprotection-2080", + database_name="testdb", + advanced_threat_protection_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py new file mode 100644 index 000000000000..a3c542c56f7f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advanced_threat_protection_settings_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advanced_threat_protection_settings.list_by_database( + resource_group_name="threatprotection-6852", + server_name="threatprotection-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py new file mode 100644 index 000000000000..0043467b95a7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advisor_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advisors.get( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + advisor_name="CreateIndex", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py new file mode 100644 index 000000000000..a142bd2b282a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advisor_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advisors.list_by_database( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py new file mode 100644 index 000000000000..fee9f7de6ff1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_advisor_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advisors.update( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + advisor_name="CreateIndex", + parameters={"properties": {"autoExecuteStatus": "Disabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py new file mode 100644 index 000000000000..831e4c171979 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_auditing_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_blob_auditing_policies.list_by_database( + resource_group_name="blobauditingtest-6852", + server_name="blobauditingtest-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py new file mode 100644 index 000000000000..5eb116e397ad --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_automatic_tuning_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.database_automatic_tuning.get( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + database_name="db1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py new file mode 100644 index 000000000000..f949a0b4ab4e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py @@ -0,0 +1,52 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_automatic_tuning_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.database_automatic_tuning.update( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + database_name="db1", + parameters={ + "properties": { + "desiredState": "Auto", + "options": { + "createIndex": {"desiredState": "Off"}, + "dropIndex": {"desiredState": "On"}, + "forceLastGoodPlan": {"desiredState": "Default"}, + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py new file mode 100644 index 000000000000..70fa97ab92b9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_automatic_tuning_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.database_automatic_tuning.update( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + database_name="db1", + parameters={"properties": {"desiredState": "Auto"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py new file mode 100644 index 000000000000..3250f6f8186d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_azure_monitor_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py new file mode 100644 index 000000000000..cd43003f2028 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py @@ -0,0 +1,59 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_blob_auditing_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={ + "properties": { + "auditActionsAndGroups": [ + "DATABASE_LOGOUT_GROUP", + "DATABASE_ROLE_MEMBER_CHANGE_GROUP", + "UPDATE on database::TestDatabaseName by public", + ], + "isAzureMonitorTargetEnabled": True, + "isStorageSecondaryKeyInUse": False, + "queueDelayMs": 4000, + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py new file mode 100644 index 000000000000..baff274b6c05 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_blob_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={ + "properties": { + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py new file mode 100644 index 000000000000..9c1a9dfb21b4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_blob_auditing_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_blob_auditing_policies.get( + resource_group_name="blobauditingtest-6852", + server_name="blobauditingtest-2080", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py new file mode 100644 index 000000000000..adfc7272f2ca --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_column_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_columns.get( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + column_name="column1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py new file mode 100644 index 000000000000..b56a1b4b68b7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_column_list_by_table.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_columns.list_by_table( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py new file mode 100644 index 000000000000..ecd2d66ec9d9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_extended_auditing_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_database_blob_auditing_policies.list_by_database( + resource_group_name="blobauditingtest-6852", + server_name="blobauditingtest-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py new file mode 100644 index 000000000000..e7be2d8528fe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_metrics_definitions_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_metric_definitions( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + database_name="3481", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py new file mode 100644 index 000000000000..520bc953da70 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_metrics_list_with_filter.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_metrics( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + database_name="3481", + filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py new file mode 100644 index 000000000000..c9ec704742c4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_recommended_action_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_recommended_actions.get( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + advisor_name="CreateIndex", + recommended_action_name="IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py new file mode 100644 index 000000000000..3e63c55c2f9c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_recommended_action_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_recommended_actions.list_by_database_advisor( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + advisor_name="CreateIndex", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py new file mode 100644 index 000000000000..29746fb88ad7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_recommended_action_list_expand.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_advisors.list_by_database( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py new file mode 100644 index 000000000000..2ae2710f5860 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_recommended_action_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_recommended_actions.update( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + database_name="IndexAdvisor_test_3", + advisor_name="CreateIndex", + recommended_action_name="IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", + parameters={"properties": {"state": {"currentValue": "Pending"}}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py new file mode 100644 index 000000000000..8dee415547a2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_restore_points_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.delete( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testserver", + database_name="testDatabase", + restore_point_name="131546477590000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py new file mode 100644 index 000000000000..b46f7902b898 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_restore_points_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testserver", + database_name="testDatabase", + restore_point_name="131546477590000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py new file mode 100644 index 000000000000..dfed545b9981 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_restore_points_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.list_by_database( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + database_name="3481", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py new file mode 100644 index 000000000000..73dc7bcf5aa5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_restore_points_post.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restore_points.begin_create( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testserver", + database_name="testDatabase", + parameters={"restorePointLabel": "mylabel"}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py new file mode 100644 index 000000000000..ff3900ead894 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_schema_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_schemas.get( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py new file mode 100644 index 000000000000..b3897e68aea9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_schema_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_schemas.list_by_database( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py new file mode 100644 index 000000000000..a5177beeb6e1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_security_alert_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_security_alert_policies.create_or_update( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + database_name="testdb", + security_alert_policy_name="Default", + parameters={ + "properties": { + "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], + "emailAccountAdmins": True, + "emailAddresses": ["test@microsoft.com", "user@microsoft.com"], + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py new file mode 100644 index 000000000000..c3e30b8314f9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_security_alert_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_security_alert_policies.create_or_update( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + database_name="testdb", + security_alert_policy_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py new file mode 100644 index 000000000000..379d5e7906a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_security_alert_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_security_alert_policies.get( + resource_group_name="securityalert-6852", + server_name="securityalert-2080", + database_name="testdb", + security_alert_policy_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py new file mode 100644 index 000000000000..6699bab786df --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_security_alert_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_security_alert_policies.list_by_database( + resource_group_name="securityalert-6852", + server_name="securityalert-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py new file mode 100644 index 000000000000..816812ab3109 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_baseline_add.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={ + "properties": { + "latestScan": False, + "results": { + "VA2063": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + "VA2065": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py new file mode 100644 index 000000000000..288766e2d07d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_baseline_add_latest.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={"properties": {"latestScan": True, "results": {}}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py new file mode 100644 index 000000000000..f7f59f2fd0f9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py new file mode 100644 index 000000000000..eb0331c24327 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py new file mode 100644 index 000000000000..37dfcc560683 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessments_settings.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py new file mode 100644 index 000000000000..e8dc23f334e7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessments_settings.list_by_database( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py new file mode 100644 index 000000000000..21b6ca02ccc5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_list_scans_results.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_scan_result.list_by_scan( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="testsvr", + database_name="master", + vulnerability_assessment_name="default", + scan_id="scanId1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py new file mode 100644 index 000000000000..37a60c75f9c9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_rule_baseline_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_rule_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + parameters={ + "properties": { + "latestScan": False, + "results": [["userA", "SELECT"], ["userB", "SELECT"], ["userC", "SELECT"]], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py new file mode 100644 index 000000000000..2258d6821930 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py new file mode 100644 index 000000000000..bfbc378838fa --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_rule_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py new file mode 100644 index 000000000000..89bf3f72618d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py new file mode 100644 index 000000000000..45fcf2070d00 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_scan.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_scans.get( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py new file mode 100644 index 000000000000..c17ce4e94c7a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_scan_records_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py new file mode 100644 index 000000000000..1ccd2f4803dc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_scans_execute.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_execute_scan.begin_execute( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py new file mode 100644 index 000000000000..13a4fdc9949f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_sql_vulnerability_assessment_scans_results.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_sql_vulnerability_assessment_scan_result.get( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="master", + vulnerability_assessment_name="default", + scan_id="scanId1", + scan_result_id="VA1234", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py new file mode 100644 index 000000000000..b7870d72226b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_table_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_tables.get( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py new file mode 100644 index 000000000000..00d3bd285bfe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_table_list_by_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_tables.list_by_schema( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py new file mode 100644 index 000000000000..7f3739623d48 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_create_container_sas_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py new file mode 100644 index 000000000000..ecd652baddd7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "recurringScans": { + "emailSubscriptionAdmins": True, + "emails": ["email1@mail.com", "email2@mail.com"], + "isEnabled": True, + }, + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py new file mode 100644 index 000000000000..64923bb89229 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_create_storage_access_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py new file mode 100644 index 000000000000..4ac95e8e8dec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py new file mode 100644 index 000000000000..68c3830d57a7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py new file mode 100644 index 000000000000..20a4ce517bac --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessments.list_by_database( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py new file mode 100644 index 000000000000..a9b0b47285d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_rule_baseline_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_rule_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + parameters={ + "properties": { + "baselineResults": [ + {"result": ["userA", "SELECT"]}, + {"result": ["userB", "SELECT"]}, + {"result": ["userC", "SELECT", "tableId_4"]}, + ] + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py new file mode 100644 index 000000000000..b1c764149d26 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py new file mode 100644 index 000000000000..2e379f723e35 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_rule_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="master", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py new file mode 100644 index 000000000000..47a7a0f97557 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_scan_export.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_scans.export( + resource_group_name="vulnerabilityassessmenttest-4799", + server_name="vulnerabilityassessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py new file mode 100644 index 000000000000..ed166af197e8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_scan_records_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_scans.get( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py new file mode 100644 index 000000000000..2538bf56fcfd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_scan_records_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_scans.list_by_database( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py new file mode 100644 index 000000000000..e67ddb60d072 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python database_vulnerability_assessment_scans_execute.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_vulnerability_assessment_scans.begin_initiate_scan( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan01", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py deleted file mode 100644 index 169b502913e0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_credential.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_credentials.delete( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - credential_name="cred1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py deleted file mode 100644 index 33265246d7a2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_firewall_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.delete( - resource_group_name="firewallrulecrudtest-9886", - server_name="firewallrulecrudtest-2368", - firewall_rule_name="firewallrulecrudtest-7011", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py deleted file mode 100644 index b4321f1f1830..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_job.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.jobs.delete( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py deleted file mode 100644 index 442ff698848d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_job_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_agents.begin_delete( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py deleted file mode 100644 index cab088a4c75b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_job_step..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.delete( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - step_name="step1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py deleted file mode 100644 index 966a52095d7f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_server_communication_link.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_communication_links.delete( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - communication_link_name="link1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py deleted file mode 100644 index a4d3ba76a2c0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_sync_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.begin_delete( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py deleted file mode 100644 index 7282e7906810..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_sync_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.begin_delete( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py deleted file mode 100644 index 2760237bedb1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_sync_member.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.begin_delete( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncgroupcrud-4879", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py deleted file mode 100644 index 9d2bbaa427af..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_target_group..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_groups.delete( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - target_group_name="targetGroup1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py deleted file mode 100644 index 7787e9b8831a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_virtual_network_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.virtual_network_rules.begin_delete( - resource_group_name="Default", - server_name="vnet-test-svr", - virtual_network_rule_name="vnet-firewall-rule", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py deleted file mode 100644 index c9c3e49c43ca..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_workload_classifier.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_classifiers.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - workload_classifier_name="wlm_workloadclassifier", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py deleted file mode 100644 index 69b6ee066564..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_a_workload_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_groups.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py deleted file mode 100644 index 506ba61f380c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_administrator_of_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_administrators.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - administrator_name="ActiveDirectory", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py deleted file mode 100644 index 5eb6fc33ceac..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_an_elastic_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_delete( - resource_group_name="sqlcrudtest-3129", - server_name="sqlcrudtest-228", - elastic_pool_name="sqlcrudtest-3851", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py deleted file mode 100644 index 11728a99db2c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_an_instance_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.begin_delete( - resource_group_name="group1", - instance_pool_name="testIP", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py deleted file mode 100644 index 3295f57eaad1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_an_ipv6_firewall_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ipv6_firewall_rules.delete( - resource_group_name="firewallrulecrudtest-9886", - server_name="firewallrulecrudtest-2368", - firewall_rule_name="firewallrulecrudtest-7011", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py deleted file mode 100644 index 29b99edd34b8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_azure_active_directory_administrator..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_azure_ad_administrators.begin_delete( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-6440", - administrator_name="ActiveDirectory", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py new file mode 100644 index 000000000000..34e2113c8729 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/DeleteDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py deleted file mode 100644 index ab3e7b9d8825..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.begin_delete( - resource_group_name="Default", - server_name="failover-group-primary-server", - failover_group_name="failover-group-test-1", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py new file mode 100644 index 000000000000..ae1fe71503a5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_instance_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.begin_delete( + resource_group_name="group1", + instance_pool_name="testIP", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py new file mode 100644 index 000000000000..e674d63eae37 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_job.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.jobs.delete( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py new file mode 100644 index 000000000000..1910de35326f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_job_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_agents.begin_delete( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py new file mode 100644 index 000000000000..37449770b808 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_job_credential.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_credentials.delete( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + credential_name="cred1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py new file mode 100644 index 000000000000..56053116c258 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_job_step.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.delete( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + step_name="step1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py new file mode 100644 index 000000000000..dde433114f55 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_job_target_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_groups.delete( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + target_group_name="targetGroup1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py deleted file mode 100644 index e065ee7443ff..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="testdb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py deleted file mode 100644 index 2e825f007534..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_delete( - resource_group_name="testrg", - managed_instance_name="testinstance", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py deleted file mode 100644 index a053d9841c3f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_managed_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_dns_aliases.begin_delete( - resource_group_name="Default", - managed_instance_name="dns-mi", - dns_alias_name="dns-alias-mi", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py deleted file mode 100644 index 8ff6aeeef2d7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_replication_link_on_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.begin_delete( - resource_group_name="Default", - server_name="sourcesvr", - database_name="gamma-db", - link_id="4891ca10-ebd0-47d7-9182-c722651780fb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py deleted file mode 100644 index e7d5c65af410..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.begin_delete( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-6661", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py deleted file mode 100644 index 9115a14ee3f1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dns_aliases.begin_delete( - resource_group_name="Default", - server_name="dns-alias-server", - dns_alias_name="dns-alias-name-1", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py deleted file mode 100644 index 8d1096589dc8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_server_trust_certificate..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", - ) - - response = client.server_trust_certificates.begin_delete( - resource_group_name="testrg", - managed_instance_name="testcl", - certificate_name="customerCertificateName", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py deleted file mode 100644 index 3bc89b248776..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_the_long_term_retention_backup..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.begin_delete( - location_name="japaneast", - long_term_retention_server_name="testserver", - long_term_retention_database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py deleted file mode 100644 index 8da61248e534..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_the_managed_instance_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_keys.begin_delete( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py deleted file mode 100644 index e5123ed013bd..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_the_server_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_keys.begin_delete( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py deleted file mode 100644 index 37e5f8a9fc9f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python delete_virtual_cluster.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.virtual_clusters.begin_delete( - resource_group_name="testrg", - virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py new file mode 100644 index 000000000000..0bd4c3f8ea38 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_workload_classifier.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_classifiers.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + workload_classifier_name="wlm_workloadclassifier", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py new file mode 100644 index 000000000000..fcd45ca4b5dd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python delete_workload_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_groups.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py new file mode 100644 index 000000000000..04eb62fe0e40 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python deleted_server_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.deleted_servers.get( + location_name="japaneast", + deleted_server_name="sqlcrudtest-d-1414", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py new file mode 100644 index 000000000000..d4e33138e134 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python deleted_server_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.deleted_servers.list_by_location( + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py new file mode 100644 index 000000000000..86548b545cf6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python deleted_server_list_by_subscription.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.deleted_servers.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py new file mode 100644 index 000000000000..cab27856101c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python deleted_server_recover.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.deleted_servers.begin_recover( + location_name="japaneast", + deleted_server_name="sqlcrudtest-d-1414", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py deleted file mode 100644 index 79b59f173dbb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DeleteDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py deleted file mode 100644 index 9f1b5d636b5f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_a_outbound_firewall_rule_with_a_given_name..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.outbound_firewall_rules.begin_delete( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-6661", - outbound_rule_fqdn="server.database.windows.net", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py deleted file mode 100644 index 6d9ad1c47771..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_a_private_endpoint_connection_with_a_given_name..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_endpoint_connections.begin_delete( - resource_group_name="Default", - managed_instance_name="test-cl", - private_endpoint_connection_name="private-endpoint-connection-name", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py deleted file mode 100644 index 17e0a6c0fb72..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_a_restore_point..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.delete( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testserver", - database_name="testDatabase", - restore_point_name="131546477590000000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py deleted file mode 100644 index 79e8233294fe..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_azure_active_directory_only_authentication_object..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_azure_ad_only_authentications.begin_delete( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - authentication_name="Default", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py deleted file mode 100644 index e86b4bacce2f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_the_sensitivity_label_of_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.delete( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py deleted file mode 100644 index e44440a13271..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.delete( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py deleted file mode 100644 index a43c53869b48..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python disables_sensitivity_recommendations_on_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.disable_recommendation( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py deleted file mode 100644 index 9b48b7b8be64..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python disables_the_sensitivity_recommendations_on_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.disable_recommendation( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py deleted file mode 100644 index ac8e1628de04..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python disables_uploading_ledger_digests_for_a_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ledger_digest_uploads.begin_disable( - resource_group_name="ledgertestrg", - server_name="ledgertestserver", - database_name="testdb", - ledger_digest_uploads="current", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py new file mode 100644 index 000000000000..8d1eca0c6e45 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python distributed_availability_groups_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.distributed_availability_groups.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testcl", + distributed_availability_group_name="dag", + parameters={ + "properties": { + "primaryAvailabilityGroupName": "BoxLocalAg1", + "secondaryAvailabilityGroupName": "testcl", + "sourceEndpoint": "TCP://SERVER:7022", + "targetDatabase": "testdb", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py new file mode 100644 index 000000000000..aef8a014a7c4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python distributed_availability_groups_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", + ) + + response = client.distributed_availability_groups.begin_delete( + resource_group_name="testrg", + managed_instance_name="testcl", + distributed_availability_group_name="dag", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py new file mode 100644 index 000000000000..3866f48340d0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python distributed_availability_groups_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", + ) + + response = client.distributed_availability_groups.get( + resource_group_name="testrg", + managed_instance_name="testcl", + distributed_availability_group_name="dag", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py new file mode 100644 index 000000000000..7c5cf95badde --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python distributed_availability_groups_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.distributed_availability_groups.list_by_instance( + resource_group_name="testrg", + managed_instance_name="testcl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py new file mode 100644 index 000000000000..62c13e4b68fc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python distributed_availability_groups_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.distributed_availability_groups.begin_update( + resource_group_name="testrg", + managed_instance_name="testcl", + distributed_availability_group_name="dag", + parameters={"properties": {"replicationMode": "Sync"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py deleted file mode 100644 index 2ec9d8e84916..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python drop_server_trust_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_trust_groups.begin_delete( - resource_group_name="Default", - location_name="Japan East", - server_trust_group_name="server-trust-group-test", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py new file mode 100644 index 000000000000..302e9555e80d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_activity_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pool_activities.list_by_elastic_pool( + resource_group_name="sqlcrudtest-4291", + server_name="sqlcrudtest-6574", + elastic_pool_name="8749", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py new file mode 100644 index 000000000000..b4ea98d420ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_create_or_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_create_or_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "location": "Japan East", + "properties": {"perDatabaseSettings": {"maxCapacity": 2, "minCapacity": 0.25}}, + "sku": {"capacity": 2, "name": "GP_Gen4_2", "tier": "GeneralPurpose"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py new file mode 100644 index 000000000000..3c076f92d377 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_create_or_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_create_or_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={"location": "Japan East"}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py new file mode 100644 index 000000000000..e025dd667b01 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_create_or_update_set_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_create_or_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "location": "Japan East", + "properties": { + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1" + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py new file mode 100644 index 000000000000..3582f91c9b25 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_database_activity_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="9d4e2ad0-e20b-4464-9219-353bded52513", + ) + + response = client.elastic_pool_database_activities.list_by_elastic_pool( + resource_group_name="sqlcrudtest-4673", + server_name="sqlcrudtest-603", + elastic_pool_name="7537", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py new file mode 100644 index 000000000000..91ff54482fd3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_delete( + resource_group_name="sqlcrudtest-3129", + server_name="sqlcrudtest-228", + elastic_pool_name="sqlcrudtest-3851", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py new file mode 100644 index 000000000000..af2c4190a2d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.get( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py new file mode 100644 index 000000000000..d408d9b19f84 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.list_by_server( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py new file mode 100644 index 000000000000..5ad837baa643 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_metrics_definitions_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.list_metric_definitions( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + elastic_pool_name="3481", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py new file mode 100644 index 000000000000..dfb5613f3f66 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_metrics_list_with_filter.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.list_metrics( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + elastic_pool_name="3481", + filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py new file mode 100644 index 000000000000..67b80b764014 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_update_assign_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "properties": { + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1" + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py new file mode 100644 index 000000000000..424e8a614e0e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "properties": { + "licenseType": "LicenseIncluded", + "perDatabaseSettings": {"maxCapacity": 1, "minCapacity": 0.25}, + "zoneRedundant": True, + }, + "sku": {"capacity": 2, "name": "BC_Gen4", "tier": "BusinessCritical"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py new file mode 100644 index 000000000000..8c6f10aa554c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python elastic_pool_update_reset_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "properties": { + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py deleted file mode 100644 index 03a8d57225c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python enables_ledger_digest_upload_configuration_for_a_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ledger_digest_uploads.begin_create_or_update( - resource_group_name="ledgertestrg", - server_name="ledgertestserver", - database_name="testdb", - ledger_digest_uploads="current", - parameters={"properties": {"digestStorageEndpoint": "https://MyAccount.blob.core.windows.net"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py deleted file mode 100644 index 105f99152280..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python enables_sensitivity_recommendations_on_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.enable_recommendation( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py deleted file mode 100644 index bb2185d9d154..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python enables_the_sensitivity_recommendations_on_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.enable_recommendation( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py new file mode 100644 index 000000000000..da4d39007c95 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python encryption_protector_create_or_update_key_vault.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={ + "properties": { + "autoRotationEnabled": False, + "serverKeyName": "someVault_someKey_01234567890123456789012345678901", + "serverKeyType": "AzureKeyVault", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py new file mode 100644 index 000000000000..8a506752ef4f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python encryption_protector_create_or_update_service_managed.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={"properties": {"serverKeyName": "ServiceManaged", "serverKeyType": "ServiceManaged"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py new file mode 100644 index 000000000000..416e64d747a7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python encryption_protector_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.encryption_protectors.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + encryption_protector_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py new file mode 100644 index 000000000000..0218e7d4d479 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python encryption_protector_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.encryption_protectors.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py new file mode 100644 index 000000000000..467457b3bd41 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python encryption_protector_revalidate.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.encryption_protectors.begin_revalidate( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + encryption_protector_name="current", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py new file mode 100644 index 000000000000..d85808a300d9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python endpoint_certificates_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + ) + + response = client.endpoint_certificates.get( + resource_group_name="testrg", + managed_instance_name="testcl", + endpoint_type="DATABASE_MIRRORING", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py new file mode 100644 index 000000000000..06ea4ecf4869 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python endpoint_certificates_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + ) + + response = client.endpoint_certificates.list_by_instance( + resource_group_name="testrg", + managed_instance_name="testcl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py b/sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py deleted file mode 100644 index 468eff27955d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python executes_a_database's_vulnerability_assessment_scan..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_scans.begin_initiate_scan( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - scan_id="scan01", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py b/sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py deleted file mode 100644 index 53088c821b11..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python export_a_database's_vulnerability_assessment_scan_results..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_scans.export( - resource_group_name="vulnerabilityassessmenttest-4799", - server_name="vulnerabilityassessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - scan_id="scan001", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py new file mode 100644 index 000000000000..4495f1f452ed --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python export_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_export( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ExportDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py new file mode 100644 index 000000000000..4f3f11533d69 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python export_database_with_network_isolation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_export( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "networkIsolation": { + "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", + "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", + }, + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py deleted file mode 100644 index a1ddd2286db8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_export( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "networkIsolation": { - "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", - "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", - }, - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ExportDatabaseWithNetworkIsolation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py deleted file mode 100644 index 400584649dc7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python exports_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_export( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ExportDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py new file mode 100644 index 000000000000..484d98f1b65f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_database_azure_monitor_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py new file mode 100644 index 000000000000..45a3174a00e9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py @@ -0,0 +1,60 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_database_blob_auditing_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={ + "properties": { + "auditActionsAndGroups": [ + "DATABASE_LOGOUT_GROUP", + "DATABASE_ROLE_MEMBER_CHANGE_GROUP", + "UPDATE on database::TestDatabaseName by public", + ], + "isAzureMonitorTargetEnabled": True, + "isStorageSecondaryKeyInUse": False, + "predicateExpression": "statement = 'select 1'", + "queueDelayMs": 4000, + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py new file mode 100644 index 000000000000..a43e48fa3a94 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_database_blob_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_database_blob_auditing_policies.create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + database_name="testdb", + parameters={ + "properties": { + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py new file mode 100644 index 000000000000..49f60a8b01ec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_database_blob_auditing_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_database_blob_auditing_policies.get( + resource_group_name="blobauditingtest-6852", + server_name="blobauditingtest-2080", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py new file mode 100644 index 000000000000..7d6f2ad4d3c7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py @@ -0,0 +1,59 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_server_blob_auditing_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_server_blob_auditing_policies.begin_create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + parameters={ + "properties": { + "auditActionsAndGroups": [ + "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", + "FAILED_DATABASE_AUTHENTICATION_GROUP", + "BATCH_COMPLETED_GROUP", + ], + "isAzureMonitorTargetEnabled": True, + "isStorageSecondaryKeyInUse": False, + "predicateExpression": "object_name = 'SensitiveData'", + "queueDelayMs": 4000, + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py new file mode 100644 index 000000000000..5be96c138cfa --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_server_blob_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_server_blob_auditing_policies.begin_create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + parameters={ + "properties": { + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py new file mode 100644 index 000000000000..37c09e531a4b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python extended_server_blob_auditing_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_server_blob_auditing_policies.get( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py deleted file mode 100644 index 7d620328daca..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python failover_a_managed_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.begin_failover( - resource_group_name="group1", - managed_instance_name="instanceName", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py deleted file mode 100644 index cf505e340eea..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python failover_an_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_failover( - resource_group_name="group1", - server_name="testServer", - database_name="testDatabase", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/FailoverDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py deleted file mode 100644 index 1848d3199517..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python failover_an_elastic_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_failover( - resource_group_name="group1", - server_name="testServer", - elastic_pool_name="testElasticPool", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/FailoverElasticPool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py new file mode 100644 index 000000000000..3ad026496905 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_failover( + resource_group_name="group1", + server_name="testServer", + database_name="testDatabase", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/FailoverDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py new file mode 100644 index 000000000000..737ae80c3f67 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_elastic_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_failover( + resource_group_name="group1", + server_name="testServer", + elastic_pool_name="testElasticPool", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/FailoverElasticPool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py new file mode 100644 index 000000000000..7361035822f1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py @@ -0,0 +1,57 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_create_or_update( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test-3", + parameters={ + "properties": { + "databases": [ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1", + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2", + ], + "partnerServers": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server" + } + ], + "readOnlyEndpoint": {"failoverPolicy": "Disabled"}, + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 480}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py new file mode 100644 index 000000000000..752e6920c641 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_delete( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test-1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py new file mode 100644 index 000000000000..ef197914664c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_failover.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_failover( + resource_group_name="Default", + server_name="failover-group-secondary-server", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py new file mode 100644 index 000000000000..f3cdaf43be42 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_force_failover_allow_data_loss.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_force_failover_allow_data_loss( + resource_group_name="Default", + server_name="failover-group-secondary-server", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py new file mode 100644 index 000000000000..a128a58374a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.get( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py new file mode 100644 index 000000000000..8d53d19722dd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.list_by_server( + resource_group_name="Default", + server_name="failover-group-primary-server", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py new file mode 100644 index 000000000000..aab88e20be6d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_group_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.failover_groups.begin_update( + resource_group_name="Default", + server_name="failover-group-primary-server", + failover_group_name="failover-group-test-1", + parameters={ + "properties": { + "databases": [ + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1" + ], + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 120}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py new file mode 100644 index 000000000000..d875350121bf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python failover_managed_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instances.begin_failover( + resource_group_name="group1", + managed_instance_name="instanceName", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py deleted file mode 100644 index 0d50a2a9715f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python filter_database_columns.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_columns.list_by_database( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py deleted file mode 100644 index 6e1f2f95d12f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python filter_managed_database_columns.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_columns.list_by_database( - resource_group_name="myRG", - managed_instance_name="serverName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py new file mode 100644 index 000000000000..6836e5bd7f14 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.create_or_update( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-5370", + parameters={"properties": {"endIpAddress": "0.0.0.3", "startIpAddress": "0.0.0.3"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py new file mode 100644 index 000000000000..0e1e24370a3f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.delete( + resource_group_name="firewallrulecrudtest-9886", + server_name="firewallrulecrudtest-2368", + firewall_rule_name="firewallrulecrudtest-7011", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py new file mode 100644 index 000000000000..3d525b8784bc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.get( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-2304", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py new file mode 100644 index 000000000000..7a29f4070b04 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.list_by_server( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py new file mode 100644 index 000000000000..45c2d6090f46 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_replace.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.replace( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + parameters={ + "values": [ + { + "name": "firewallrulecrudtest-5370 ", + "properties": {"endIpAddress": "100.0.0.0", "startIpAddress": "0.0.0.0"}, + } + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py new file mode 100644 index 000000000000..eb1f687bb3d3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python firewall_rule_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.firewall_rules.create_or_update( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-3927", + parameters={"properties": {"endIpAddress": "0.0.0.1", "startIpAddress": "0.0.0.1"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py deleted file mode 100644 index dbc4adb86298..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python forced_failover_of_a_failover_group_allowing_data_loss.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.begin_force_failover_allow_data_loss( - resource_group_name="Default", - server_name="failover-group-secondary-server", - failover_group_name="failover-group-test-3", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py deleted file mode 100644 index dc790a4c861c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python forced_failover_of_a_replication_link.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.begin_failover_allow_data_loss( - resource_group_name="Default", - server_name="sourcesvr", - database_name="gamma-db", - link_id="4891ca10-ebd0-47d7-9182-c722651780fb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py deleted file mode 100644 index 2ad5c5eb50dc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python generate_a_sync_agent_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.generate_key( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py new file mode 100644 index 000000000000..b1f7abe48b8c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python geo_backup_policies_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.geo_backup_policies.create_or_update( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-5961", + database_name="testdw", + geo_backup_policy_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py new file mode 100644 index 000000000000..9fea1e16d09e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python geo_backup_policies_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.geo_backup_policies.get( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-5961", + database_name="testdw", + geo_backup_policy_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py new file mode 100644 index 000000000000..e17e959b1c6e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python geo_backup_policies_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.geo_backup_policies.list_by_database( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-5961", + database_name="testdw", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py deleted file mode 100644 index 51c98f57dabd..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_credential.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_credentials.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - credential_name="cred1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py deleted file mode 100644 index acdcabcab5ba..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advanced_threat_protection_settings.get( - resource_group_name="threatprotection-6852", - server_name="threatprotection-2080", - database_name="testdb", - advanced_threat_protection_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py deleted file mode 100644 index df33b5c27185..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_automatic_tuning_settings.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.database_automatic_tuning.get( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - database_name="db1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py deleted file mode 100644 index e414a8601bb8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_blob_auditing_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_blob_auditing_policies.get( - resource_group_name="blobauditingtest-6852", - server_name="blobauditingtest-2080", - database_name="testdb", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py deleted file mode 100644 index b90ad17dd08b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_threat_detection_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_security_alert_policies.get( - resource_group_name="securityalert-6852", - server_name="securityalert-2080", - database_name="testdb", - security_alert_policy_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py deleted file mode 100644 index 0516401d5226..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_transparent_data_encryption.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_transparent_data_encryption.get( - resource_group_name="security-tde-resourcegroup", - managed_instance_name="securitytde", - database_name="testdb", - tde_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py deleted file mode 100644 index ffe9f388234c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.get( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py deleted file mode 100644 index 52b1a153b390..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_vulnerability_assessment_scan..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_scans.get( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - scan_id="scan001", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py deleted file mode 100644 index 1a4e5907aa4f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database's_vulnerability_assessments_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_vulnerability_assessments.list_by_database( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py deleted file mode 100644 index d5090822c4a7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_scan_result.get( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - database_name="master", - vulnerability_assessment_name="default", - scan_id="scanId1", - scan_result_id="VA1234", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py deleted file mode 100644 index 85716fad4a25..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_hub_database_schema..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.list_hub_schemas( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py deleted file mode 100644 index 9cce79460d48..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_hyperscale_elastic_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.get( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py deleted file mode 100644 index cfdae5193465..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_job.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.jobs.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py deleted file mode 100644 index cce8aed2ff18..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_job_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_agents.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py deleted file mode 100644 index 68c96615fd45..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_job_execution..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py deleted file mode 100644 index c7d96ac36cbf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_job_step_execution.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_step_executions.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - step_name="step1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py deleted file mode 100644 index e98f1d0d0204..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_job_step_target_execution.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_executions.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - step_name="step1", - target_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py deleted file mode 100644 index d541ea9c1d60..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_list_of_endpoint_certificates..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", - ) - - response = client.endpoint_certificates.list_by_instance( - resource_group_name="testrg", - managed_instance_name="testcl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py deleted file mode 100644 index e8bf05652726..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_list_of_the_database's_threat_detection_policies..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_security_alert_policies.list_by_database( - resource_group_name="securityalert-6852", - managed_instance_name="securityalert-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py deleted file mode 100644 index c771bea6e4de..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_list_of_the_database's_transparent_data_encryption.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.transparent_data_encryptions.list_by_database( - resource_group_name="security-tde-resourcegroup", - server_name="securitytde", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py deleted file mode 100644 index 858357875d6e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_list_of_the_database's_transparent_data_encryptions.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_transparent_data_encryption.list_by_database( - resource_group_name="security-tde-resourcegroup", - managed_instance_name="securitytde", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py deleted file mode 100644 index d12691403aa9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_list_of_the_managed_database's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_advanced_threat_protection_settings.list_by_database( - resource_group_name="threatprotection-6852", - managed_instance_name="threatprotection-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py deleted file mode 100644 index c670f3d83db8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_managed_database's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_advanced_threat_protection_settings.get( - resource_group_name="threatprotection-6852", - managed_instance_name="threatprotection-2080", - database_name="testdb", - advanced_threat_protection_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py deleted file mode 100644 index 32a53a957a91..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_managed_instance's_advanced_threat_protection_settings.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_advanced_threat_protection_settings.get( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - advanced_threat_protection_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py deleted file mode 100644 index ea9ecf43c1ca..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_managed_instance's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.get( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py deleted file mode 100644 index d392d643f40e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_managed_instance's_vulnerability_assessment_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.list_by_instance( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py deleted file mode 100644 index adbfeff47200..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_managed_server's_threat_detection_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_security_alert_policies.get( - resource_group_name="securityalert-4799", - managed_instance_name="securityalert-6440", - security_alert_policy_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py deleted file mode 100644 index c2ae026834a0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_recoverable_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.recoverable_databases.get( - resource_group_name="recoverabledatabasetest-6852", - server_name="recoverabledatabasetest-2080", - database_name="recoverabledatabasetest-9187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py deleted file mode 100644 index 20e37a40c4a4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_advanced_threat_protection_settings.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advanced_threat_protection_settings.get( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - advanced_threat_protection_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py deleted file mode 100644 index 5547f06db638..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_automatic_tuning_settings.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.server_automatic_tuning.get( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py deleted file mode 100644 index 6da3931a1707..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_blob_auditing_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_blob_auditing_policies.get( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py deleted file mode 100644 index d25f7ea28f5a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_blob_extended_auditing_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_server_blob_auditing_policies.get( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py deleted file mode 100644 index 289895c9d490..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_dev_ops_audit_settings.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dev_ops_audit_settings.get( - resource_group_name="devAuditTestRG", - server_name="devOpsAuditTestSvr", - dev_ops_auditing_settings_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py deleted file mode 100644 index f2ca3698ae67..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_threat_detection_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_security_alert_policies.get( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - security_alert_policy_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py deleted file mode 100644 index c07cff030020..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.get( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py deleted file mode 100644 index cf03dfd7aa92..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server's_vulnerability_assessment_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.list_by_server( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py deleted file mode 100644 index ecb55dd26d97..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_server_communication_link.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_communication_links.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - communication_link_name="link1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py deleted file mode 100644 index 6edfc52a739d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_service_objective.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.service_objectives.get( - resource_group_name="group1", - server_name="sqlcrudtest", - service_objective_name="29dd7459-4a7c-4e56-be22-f0adda49440d", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py deleted file mode 100644 index 24b913111c60..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_sync_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.get( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py deleted file mode 100644 index 6c9332664eda..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_sync_database_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.list_sync_database_ids( - location_name="westus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py deleted file mode 100644 index 465fb0266486..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_sync_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.get( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py deleted file mode 100644 index de1f0f54995e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_sync_member.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.get( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncmembercrud-4879", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py deleted file mode 100644 index f93cc09a106c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_sync_member_schema.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.list_member_schemas( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncgroupcrud-4879", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py deleted file mode 100644 index 871058a5be19..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessment_scan_result.get( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - vulnerability_assessment_name="default", - scan_id="scanId1", - scan_result_id="VA1234", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py deleted file mode 100644 index 03b7b3915bd2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_target_group..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_groups.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - target_group_name="targetGroup1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py deleted file mode 100644 index 8829512f1280..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_a_version_of_a_job..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_versions.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_version="1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py deleted file mode 100644 index 695b942f401e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_administrator_of_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_administrators.get( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - administrator_name="ActiveDirectory", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py deleted file mode 100644 index e0fdf996004e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_elastic_pools_in_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.list_by_server( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py deleted file mode 100644 index 3df1b3b54db7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_long_term_retention_backups_under_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.list_by_database( - location_name="japaneast", - long_term_retention_server_name="testserver", - long_term_retention_database_name="testDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py deleted file mode 100644 index 80824e8c06d8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_long_term_retention_backups_under_the_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.list_by_location( - location_name="japaneast", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py deleted file mode 100644 index b2c668efdc18..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_long_term_retention_backups_under_the_managed_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_managed_instance_backups.list_by_instance( - location_name="japaneast", - managed_instance_name="testInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py deleted file mode 100644 index d31049eee2db..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_long_term_retention_backups_under_the_server..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.list_by_server( - location_name="japaneast", - long_term_retention_server_name="testserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py deleted file mode 100644 index 798801cf26a1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_target_groups_in_an_agent..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_groups.list_by_agent( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py deleted file mode 100644 index 6e206062d584..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_all_versions_of_a_job..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_versions.list_by_job( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py deleted file mode 100644 index d6357fa51225..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_an_elastic_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.get( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py deleted file mode 100644 index 46bcdc509713..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_an_extended_database's_blob_auditing_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_database_blob_auditing_policies.get( - resource_group_name="blobauditingtest-6852", - server_name="blobauditingtest-2080", - database_name="testdb", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py deleted file mode 100644 index 50caecfccf39..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_an_instance_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.get( - resource_group_name="group1", - instance_pool_name="testIP", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py deleted file mode 100644 index f2bd67dbb3a8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_data_masking_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_policies.get( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py new file mode 100644 index 000000000000..ef556167341c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_data_warehouse_user_activities.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_warehouse_user_activities.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + data_warehouse_user_activity_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py deleted file mode 100644 index 863a53faafe2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_advisor.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advisors.get( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - advisor_name="CreateIndex", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py deleted file mode 100644 index 5ab01f6050c6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_columns.get( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - schema_name="dbo", - table_name="table1", - column_name="column1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions..py deleted file mode 100644 index cdc030703ff6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_extensions..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="a3473687-7581-41e1-ac24-6bcca5843f07", - ) - - response = client.database_extensions.get( - resource_group_name="rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", - server_name="srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", - database_name="11aa6c5e-58ed-4693-b303-3b8e3131deaa", - extension_name="polybaseimport", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py new file mode 100644 index 000000000000..3220104022b0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_database_extensions.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="a3473687-7581-41e1-ac24-6bcca5843f07", + ) + + response = client.database_extensions.get( + resource_group_name="rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", + server_name="srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", + database_name="11aa6c5e-58ed-4693-b303-3b8e3131deaa", + extension_name="polybaseimport", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py deleted file mode 100644 index 71c5caea4277..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_recommended_action.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_recommended_actions.get( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - advisor_name="CreateIndex", - recommended_action_name="IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py deleted file mode 100644 index e9c914f1d945..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_schema.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_schemas.get( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - schema_name="dbo", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py deleted file mode 100644 index 0c0884f4a4bc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_database_table.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_tables.get( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - schema_name="dbo", - table_name="table1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py new file mode 100644 index 000000000000..1e15d100eea9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_database_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_usages.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py deleted file mode 100644 index 8740a384d4cf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_deleted_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.deleted_servers.get( - location_name="japaneast", - deleted_server_name="sqlcrudtest-d-1414", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py deleted file mode 100644 index 2a5d41f54557..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.get( - resource_group_name="Default", - server_name="failover-group-primary-server", - failover_group_name="failover-group-test", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py deleted file mode 100644 index 61025f562920..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_firewall_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.get( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-2304", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py deleted file mode 100644 index f5e2fbe74f52..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_geo_backup_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.geo_backup_policies.get( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-5961", - database_name="testdw", - geo_backup_policy_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py new file mode 100644 index 000000000000..71fe04535a1d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_instance_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.get( + resource_group_name="group1", + instance_pool_name="testIP", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py deleted file mode 100644 index 88bb00f7a73d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_ipv6_firewall_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ipv6_firewall_rules.get( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-2304", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py new file mode 100644 index 000000000000..fc93f8f7c280 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.jobs.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py new file mode 100644 index 000000000000..5c6e1c00c41b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_agents.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py new file mode 100644 index 000000000000..8a64641be748 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_credential.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_credentials.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + credential_name="cred1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py new file mode 100644 index 000000000000..c3c73057e9ce --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_execution.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py new file mode 100644 index 000000000000..8fcec1ced544 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_execution_step.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_step_executions.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + step_name="step1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py new file mode 100644 index 000000000000..06685247afab --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_execution_target.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_executions.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + step_name="step1", + target_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py new file mode 100644 index 000000000000..4967545777aa --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_step_by_job.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + step_name="step1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py new file mode 100644 index 000000000000..1008d8a8bfb4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_step_by_version.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.get_by_version( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_version="1", + step_name="step1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py new file mode 100644 index 000000000000..a722407b746e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_target_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_groups.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + target_group_name="targetGroup1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py new file mode 100644 index 000000000000..51f069d057b2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_job_version.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_versions.get( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_version="1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py new file mode 100644 index 000000000000..f5b85619fe19 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_list_managed_short_term_retention_policy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_backup_short_term_retention_policies.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py new file mode 100644 index 000000000000..9f061ebc9987 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_list_managed_short_term_retention_policy_restorable_dropped.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py deleted file mode 100644 index 44c3f13ce0a6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_list_of_restorable_dropped_databases.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.recoverable_databases.list_by_server( - resource_group_name="recoverabledatabasetest-1234", - server_name="recoverabledatabasetest-7177", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py new file mode 100644 index 000000000000..ac9a65dfad37 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_maintenance_window_options.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.maintenance_window_options.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + maintenance_window_options_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py new file mode 100644 index 000000000000..0a323beb8df9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_maintenance_windows.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.maintenance_windows.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + maintenance_window_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py deleted file mode 100644 index aa953d66b985..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_database_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_columns.get( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="table1", - column_name="column1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py deleted file mode 100644 index be20b00b6171..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_database_schema.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_schemas.get( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py deleted file mode 100644 index dea0830eca7f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_database_table.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_tables.get( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="table1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py deleted file mode 100644 index 45ec8b94b56d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.managed_instances.get( - resource_group_name="testrg", - managed_instance_name="testinstance", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py new file mode 100644 index 000000000000..0a86b623f1fb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_managed_instance_operation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_operations.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + operation_id="00000000-1111-2222-3333-444444444444", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py deleted file mode 100644 index 4a9829e5c7f6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_instance_time_zone.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", - ) - - response = client.time_zones.get( - location_name="canadaeast", - time_zone_id="Haiti Standard Time", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py deleted file mode 100644 index 6e8ad1dcbe8e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_instance_with_$expand=administrators/activedirectory.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.managed_instances.get( - resource_group_name="testrg", - managed_instance_name="testinstance", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py deleted file mode 100644 index 6e7bac4c8e1d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_managed_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_dns_aliases.get( - resource_group_name="Default", - managed_instance_name="dns-mi", - dns_alias_name="dns-alias-mi", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py new file mode 100644 index 000000000000..e283f5a2c9fd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_managed_short_term_retention_policy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_backup_short_term_retention_policies.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + database_name="testdb", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py new file mode 100644 index 000000000000..489df0a0f1e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_managed_short_term_retention_policy_restorable_dropped.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py new file mode 100644 index 000000000000..8cda3453abf0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_recoverable_managed_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.recoverable_managed_databases.get( + resource_group_name="Test1", + managed_instance_name="managedInstance", + recoverable_database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py new file mode 100644 index 000000000000..98be3cabb77c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_restorable_dropped_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restorable_dropped_databases.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py new file mode 100644 index 000000000000..aebe96b334c1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_restorable_dropped_managed_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restorable_dropped_managed_databases.get( + resource_group_name="Test1", + managed_instance_name="managedInstance", + restorable_dropped_database_id="testdb,131403269876900000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_server.py deleted file mode 100644 index 2f0e5b0e9525..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py deleted file mode 100644 index 1f4acec8c77c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_server_advisor.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advisors.get( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - advisor_name="CreateIndex", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py deleted file mode 100644 index 8518bd317273..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_server_dns_alias.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dns_aliases.get( - resource_group_name="Default", - server_name="dns-alias-server", - dns_alias_name="dns-alias-name-1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py deleted file mode 100644 index 839eb16052b3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_server_trust_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_trust_groups.get( - resource_group_name="Default", - location_name="Japan East", - server_trust_group_name="server-trust-group-test", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py deleted file mode 100644 index 3091ee94af6c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_server_with_$expand=administrators.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py new file mode 100644 index 000000000000..0fb6e882f1d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_short_term_retention_policy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.backup_short_term_retention_policies.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py deleted file mode 100644 index b367871d5e62..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_specific_subscription_usage_in_the_given_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.subscription_usages.get( - location_name="WestUS", - usage_name="ServerQuota", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py deleted file mode 100644 index d427542f2242..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sql_vulnerability_assessment_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessments_settings.list_by_server( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py deleted file mode 100644 index 8e96bad3c169..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sql_vulnerability_assessment_policies_on_a_given_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessments_settings.list_by_database( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py deleted file mode 100644 index bd572aa986de..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sql_vulnerability_assessment_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessments_settings.get( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py deleted file mode 100644 index de7b638bcb88..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sql_vulnerability_assessment_policy_for_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessments_settings.get( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py deleted file mode 100644 index 0b2bd6025774..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sync_agent_linked_databases.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.list_linked_databases( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py deleted file mode 100644 index 9313065c0ce8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sync_agents_under_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.list_by_server( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py deleted file mode 100644 index df45c93608b0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_sync_group_logs.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.list_logs( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - start_time="2017-01-01T00:00:00", - end_time="2017-12-31T00:00:00", - type="All", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py deleted file mode 100644 index 972cd407262f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_database's_threat_detection_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_security_alert_policies.list_by_database( - resource_group_name="securityalert-6852", - server_name="securityalert-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py deleted file mode 100644 index b717dbd83fd5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_database's_vulnerability_assessment_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.list_by_database( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py deleted file mode 100644 index 9a69eb7ce5bf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_encryption_protector.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.encryption_protectors.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - encryption_protector_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py deleted file mode 100644 index cb0939974f87..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_latest_version_of_a_job_step..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.get( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - step_name="step1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py deleted file mode 100644 index 109037f2e780..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_list_of_the_user_activities_of_a_data_warehouse.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_warehouse_user_activities.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - data_warehouse_user_activity_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py deleted file mode 100644 index 94d20b68661a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_list_of_workload_classifiers_for_a_workload_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_classifiers.list_by_workload_group( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py deleted file mode 100644 index 14ccc8fb57cb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_list_of_workload_groups_for_a_data_warehouse.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_groups.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py deleted file mode 100644 index 47e662e16794..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_long_term_retention_backup..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.get( - location_name="japaneast", - long_term_retention_server_name="testserver", - long_term_retention_database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py deleted file mode 100644 index 99ef829e21aa..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_long_term_retention_backup_of_a_managed_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_managed_instance_backups.get( - location_name="japaneast", - managed_instance_name="testInstance", - database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py deleted file mode 100644 index c4ee777bd1f7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_long_term_retention_policies_for_the_managed_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_long_term_retention_policies.list_by_database( - resource_group_name="testResourceGroup", - managed_instance_name="testInstance", - database_name="testDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py deleted file mode 100644 index 003bca2de7d0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_long_term_retention_policy_for_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_policies.get( - resource_group_name="resourceGroup", - server_name="testserver", - database_name="testDatabase", - policy_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py deleted file mode 100644 index 0f7568ba01f9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_long_term_retention_policy_for_the_managed_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_long_term_retention_policies.get( - resource_group_name="testResourceGroup", - managed_instance_name="testInstance", - database_name="testDatabase", - policy_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py deleted file mode 100644 index d68ba65a7d52..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_managed_database's_security_events_with_maximal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_security_events.list_by_database( - resource_group_name="testrg", - managed_instance_name="testcl", - database_name="database1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py deleted file mode 100644 index 972b5c27bcbc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_managed_database's_security_events_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_security_events.list_by_database( - resource_group_name="testrg", - managed_instance_name="testcl", - database_name="database1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py deleted file mode 100644 index af0de05a38e6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_managed_instance_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_keys.get( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py deleted file mode 100644 index 430967979785..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_managed_server's_threat_detection_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_security_alert_policies.list_by_instance( - resource_group_name="securityalert-4799", - managed_instance_name="securityalert-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py deleted file mode 100644 index f8e0ee932976..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_server_key.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_keys.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - key_name="someVault_someKey_01234567890123456789012345678901", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py deleted file mode 100644 index e4fe4d76b4c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_short_term_retention_policy_for_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_backup_short_term_retention_policies.get( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="testsvr", - database_name="testdb", - policy_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py deleted file mode 100644 index 54e1f65a5e1a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_short_term_retention_policy_list_for_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_backup_short_term_retention_policies.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="testsvr", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py deleted file mode 100644 index 26062f9942e8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python get_the_specified_version_of_a_job_step..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.get_by_version( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_version="1", - step_name="step1", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py new file mode 100644 index 000000000000..81af97d69edc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_vcore_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/GetVCoreDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py new file mode 100644 index 000000000000..c78aa20af8ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_vcore_database_default_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py new file mode 100644 index 000000000000..94b4712d6c9a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_vcore_database_vbs_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/GetVCoreDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py new file mode 100644 index 000000000000..e7468437a3c3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_workload_classifier.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_classifiers.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + workload_classifier_name="wlm_classifier", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py new file mode 100644 index 000000000000..310b5bd9b53f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_workload_classifier_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_classifiers.list_by_workload_group( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="wlm_workloadgroup", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py new file mode 100644 index 000000000000..9955c76c4cbd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_workload_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_groups.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="smallrc", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py new file mode 100644 index 000000000000..96b2e55f21e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python get_workload_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.workload_groups.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py deleted file mode 100644 index b9bbfea6fbba..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_azure_active_directory_administrator..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_azure_ad_administrators.get( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-6440", - administrator_name="ActiveDirectory", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py deleted file mode 100644 index 7134e81cdd1d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_azure_active_directory_only_authentication_property..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_azure_ad_only_authentications.get( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - authentication_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py deleted file mode 100644 index 5401f05302bc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_database's_sql_vulnerability_assessment_rule_baseline..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_rule_baselines.get( - resource_group_name="vulnerabilityaseessmenttest-4711", - server_name="vulnerabilityaseessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - baseline_name="default", - rule_id="VA1001", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py deleted file mode 100644 index f4e314388c40..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_database's_vulnerability_assessment_rule_baseline..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_rule_baselines.get( - resource_group_name="vulnerabilityaseessmenttest-4711", - server_name="vulnerabilityaseessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - rule_id="VA1001", - baseline_name="master", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py deleted file mode 100644 index ddef0547c20f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/GetVCoreDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py deleted file mode 100644 index cf2b7367c632..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_database_restore_point..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testserver", - database_name="testDatabase", - restore_point_name="131546477590000000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py deleted file mode 100644 index a41f28cb580d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_database_vulnerability_assessment_scan_record_by_scan_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_scans.get( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - scan_id="scan001", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py deleted file mode 100644 index 5593e6f8a120..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_datawarehouse_database_restore_point..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testserver", - database_name="testDatabase", - restore_point_name="131546477590000000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py deleted file mode 100644 index a9aa56cf3947..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_available_maintenance_windows_for_a_selected_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.maintenance_window_options.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - maintenance_window_options_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py deleted file mode 100644 index b87648885cee..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_azure_active_directory_administrator..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_azure_ad_administrators.list_by_server( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py deleted file mode 100644 index 4edcf1634cc8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_azure_active_directory_only_authentication_object..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_azure_ad_only_authentications.list_by_instance( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py deleted file mode 100644 index cc8626b62896..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( - resource_group_name="vulnerabilityaseessmenttest-4711", - server_name="vulnerabilityaseessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py deleted file mode 100644 index 3f4240e77045..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_databases..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.list_by_server( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListVCoreDatabasesByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py deleted file mode 100644 index 9c5f84c9984a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_databases_in_an_elastic_pool..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.list_by_elastic_pool( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - elastic_pool_name="pool1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListDatabasesByElasticPool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py deleted file mode 100644 index 87ae27169896..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_inaccessible_databases_in_a_logical_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.list_inaccessible_by_server( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py deleted file mode 100644 index e7f7b9768060..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_managed_instance_dtc_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_dtcs.list_by_managed_instance( - resource_group_name="testrg", - managed_instance_name="testinstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py deleted file mode 100644 index 0b1eab03650c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_restorable_dropped_databases..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restorable_dropped_databases.list_by_server( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py deleted file mode 100644 index 2e7d76f27c88..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_list_of_server_trust_certificates_on_a_given_server..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", - ) - - response = client.server_trust_certificates.list_by_instance( - resource_group_name="testrg", - managed_instance_name="testcl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py deleted file mode 100644 index d91442670876..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.get( - resource_group_name="Test1", - managed_instance_name="managedInstance", - database_name="managedDatabase", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py deleted file mode 100644 index a4836a7a9a13..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_managed_database_move_operation..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_move_operations.get( - resource_group_name="rg1", - location_name="westeurope", - operation_id="15961324-d809-46ed-86b9-d786953140e2", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py deleted file mode 100644 index 8a3c127030bf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_private_link_resource_for_sql..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_link_resources.get( - resource_group_name="Default", - managed_instance_name="test-cl", - group_name="plr", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py deleted file mode 100644 index a4979f168c7d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_recoverable_databases_by_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.recoverable_managed_databases.get( - resource_group_name="Test1", - managed_instance_name="managedInstance", - recoverable_database_name="testdb", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py deleted file mode 100644 index 6f2b4002e452..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_restorable_dropped_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restorable_dropped_databases.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - restorable_dropped_database_id="testdb,131403269876900000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py deleted file mode 100644 index da10c9882d9c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_restorable_dropped_managed_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restorable_dropped_managed_databases.get( - resource_group_name="Test1", - managed_instance_name="managedInstance", - restorable_dropped_database_id="testdb,131403269876900000", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py deleted file mode 100644 index 3f31253c7af7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_server_connection_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_connection_policies.get( - resource_group_name="rgtest-12", - server_name="servertest-6285", - connection_policy_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py deleted file mode 100644 index 0c00187c26bc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( - resource_group_name="vulnerabilityaseessmenttest-4711", - server_name="vulnerabilityaseessmenttest-6411", - vulnerability_assessment_name="default", - baseline_name="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py deleted file mode 100644 index 6c7f439c8340..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_virtual_cluster.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.virtual_clusters.get( - resource_group_name="testrg", - virtual_cluster_name="vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py deleted file mode 100644 index 8fff2dbbba8f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_virtual_network_rule.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.virtual_network_rules.get( - resource_group_name="Default", - server_name="vnet-test-svr", - virtual_network_rule_name="vnet-firewall-rule", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py deleted file mode 100644 index 463936575cd5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_workload_classifier_for_a_data_warehouse.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_classifiers.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="wlm_workloadgroup", - workload_classifier_name="wlm_classifier", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py deleted file mode 100644 index 6d26c42f34c3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_a_workload_group_for_a_data_warehouse.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.workload_groups.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - workload_group_name="smallrc", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py deleted file mode 100644 index 6aceafb38863..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_move_operations.list_by_location( - resource_group_name="rg1", - location_name="westeurope", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py deleted file mode 100644 index 631e349764f3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_an_endpoint_certificate..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", - ) - - response = client.endpoint_certificates.get( - resource_group_name="testrg", - managed_instance_name="testcl", - endpoint_type="DATABASE_MIRRORING", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py deleted file mode 100644 index 6467bedde389..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_current_instance_sql_agent_configuration..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_agent.get( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py deleted file mode 100644 index b2d6e68be5ae..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_database_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_usages.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py deleted file mode 100644 index 04bf33f5cd89..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_list_of_ledger_digest_upload_settings_on_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ledger_digest_uploads.list_by_database( - resource_group_name="ledgertestrg", - server_name="ledgertestserver", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py deleted file mode 100644 index f13a8c0a5f45..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_list_of_outbound_firewall_rules_on_a_server..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.outbound_firewall_rules.list_by_server( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py deleted file mode 100644 index a700bee1a7cc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_list_of_private_endpoint_connections_on_a_server..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_endpoint_connections.list_by_managed_instance( - resource_group_name="Default", - managed_instance_name="test-cl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py deleted file mode 100644 index 180515395cb9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_maintenance_window_settings_for_a_selected_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.maintenance_windows.get( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - maintenance_window_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py deleted file mode 100644 index 83f2d8f8e167..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_managed_instance_dtc_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_dtcs.get( - resource_group_name="testrg", - managed_instance_name="testinstance", - dtc_name="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py deleted file mode 100644 index a40d346268fe..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_outbound_firewall_rule..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.outbound_firewall_rules.get( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - outbound_rule_fqdn="server.database.windows.net", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py deleted file mode 100644 index 3e751c3df2bb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_private_endpoint_connection..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_endpoint_connections.get( - resource_group_name="Default", - managed_instance_name="test-cl", - private_endpoint_connection_name="private-endpoint-connection-name", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py deleted file mode 100644 index 1a2b08e4368f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_private_link_resources_for_sql..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_private_link_resources.list_by_managed_instance( - resource_group_name="Default", - managed_instance_name="test-cl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py deleted file mode 100644 index 48ed13b0f9c1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_server_trust_certificate..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", - ) - - response = client.server_trust_certificates.get( - resource_group_name="testrg", - managed_instance_name="testcl", - certificate_name="customerCertificateName", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py deleted file mode 100644 index cab4f5507ed5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_a_database_vulnerability_assessment_scan_records.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessment_scans.get( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - vulnerability_assessment_name="default", - scan_id="scan001", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScan.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py deleted file mode 100644 index d0d82a425c62..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_current_ledger_digest_upload_configuration_for_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ledger_digest_uploads.get( - resource_group_name="ledgertestrg", - server_name="ledgertestserver", - database_name="testdb", - ledger_digest_uploads="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py deleted file mode 100644 index f3d1d20ba526..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_current_sensitivity_labels_of_a_given_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.list_current_by_database( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py deleted file mode 100644 index fd99915dab92..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.list_current_by_database( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py deleted file mode 100644 index 0e02c864f1ef..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_distributed_availability_group_info..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", - ) - - response = client.distributed_availability_groups.get( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py deleted file mode 100644 index e84ee39f0137..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_move_operations.list_by_location( - resource_group_name="rg1", - location_name="westeurope", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py deleted file mode 100644 index 0518d9265981..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_move_operations.list_by_location( - resource_group_name="rg1", - location_name="westeurope", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListLastOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py deleted file mode 100644 index 6c17745b8cda..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_list_of_a_database_vulnerability_assessment_scan_records.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_scans.list_by_database( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="vulnerabilityassessmenttest-6411", - database_name="testdb", - vulnerability_assessment_name="default", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py deleted file mode 100644 index 14b68a83077b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_managed_instance_management_operation.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_operations.get( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - operation_id="00000000-1111-2222-3333-444444444444", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py deleted file mode 100644 index 1f8e9ce4e0e2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_recommended_sensitivity_labels_of_a_given_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.list_recommended_by_database( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py deleted file mode 100644 index 46014687c396..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.list_recommended_by_database( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py deleted file mode 100644 index abddcf3e02f7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_replication_link..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.get( - resource_group_name="Default", - server_name="sourcesvr", - database_name="gamma-db", - link_id="4891ca10-ebd0-47d7-9182-c722651780fb", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py deleted file mode 100644 index d705b50d1a10..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_sensitivity_label_of_a_given_column.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.get( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - sensitivity_label_source="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py deleted file mode 100644 index 72c1ae468e18..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.get( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - sensitivity_label_source="current", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py new file mode 100644 index 000000000000..1bda012728e1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_create_or_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "location": "Japan East", + "properties": {"highAvailabilityReplicaCount": 2}, + "sku": {"name": "HS_Gen5_4"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py new file mode 100644 index 000000000000..16af11e7a244 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python hyperscale_elastic_pool_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.get( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py new file mode 100644 index 000000000000..eabcbf7d60e9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python hyperscale_elastic_pool_update_set_high_availability_replica_count.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={"properties": {"highAvailabilityReplicaCount": 2}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py new file mode 100644 index 000000000000..05a7b73e024b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python import_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_import_method( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ImportDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py new file mode 100644 index 000000000000..4f6b108fbe7f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python import_database_with_network_isolation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_import_method( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "networkIsolation": { + "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", + "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", + }, + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py new file mode 100644 index 000000000000..945b426e91f2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python import_new_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.begin_import_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "databaseName": "testdb", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py new file mode 100644 index 000000000000..1a8273b45cf0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python import_new_database_with_network_isolation.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.begin_import_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + parameters={ + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "databaseName": "testdb", + "networkIsolation": { + "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", + "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", + }, + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py deleted file mode 100644 index ea6a0291dccd..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.begin_import_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "databaseName": "testdb", - "networkIsolation": { - "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", - "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", - }, - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py deleted file mode 100644 index d18f59358748..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python imports_to_a_new_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.begin_import_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "databaseName": "testdb", - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py deleted file mode 100644 index 254d1b248c2c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_import_method( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "networkIsolation": { - "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr", - "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink", - }, - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ImportDatabaseWithNetworkIsolation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py deleted file mode 100644 index 30cf33c398da..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python imports_to_an_existing_empty_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_import_method( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "administratorLogin": "login", - "administratorLoginPassword": "password", - "authenticationType": "Sql", - "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==", - "storageKeyType": "StorageAccessKey", - "storageUri": "https://test.blob.core.windows.net/test.bacpac", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ImportDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py new file mode 100644 index 000000000000..73b873dc7e23 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python inaccessible_managed_database_list_by_managed_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.list_inaccessible_by_instance( + resource_group_name="testrg", + managed_instance_name="testcl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py b/sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py deleted file mode 100644 index 4d3cfbfe97d1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python initiate_a_distributed_availability_group_drop..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", - ) - - response = client.distributed_availability_groups.begin_delete( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py new file mode 100644 index 000000000000..41c1b20ca3d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.begin_create_or_update( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test-3", + parameters={ + "properties": { + "managedInstancePairs": [ + { + "partnerManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance", + "primaryManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance", + } + ], + "partnerRegions": [{"location": "Japan West"}], + "readOnlyEndpoint": {"failoverPolicy": "Disabled"}, + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 480}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py new file mode 100644 index 000000000000..af46b6ef9734 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.begin_delete( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test-1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py new file mode 100644 index 000000000000..010613527e8e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_failover.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.begin_failover( + resource_group_name="Default", + location_name="Japan West", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupFailover.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py new file mode 100644 index 000000000000..5dd08b0f1fc4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_force_failover_allow_data_loss.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.begin_force_failover_allow_data_loss( + resource_group_name="Default", + location_name="Japan West", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py new file mode 100644 index 000000000000..e5fd93c37001 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.get( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py new file mode 100644 index 000000000000..e204acd5ee55 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python instance_failover_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.list_by_location( + resource_group_name="Default", + location_name="Japan East", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py new file mode 100644 index 000000000000..0f1d5fa77024 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ipv6_firewall_rule_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ipv6_firewall_rules.create_or_update( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-5370", + parameters={ + "properties": { + "endIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0003", + "startIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0003", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py new file mode 100644 index 000000000000..fdee6ffb6a56 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ipv6_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ipv6_firewall_rules.delete( + resource_group_name="firewallrulecrudtest-9886", + server_name="firewallrulecrudtest-2368", + firewall_rule_name="firewallrulecrudtest-7011", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py new file mode 100644 index 000000000000..ccff9a831532 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ipv6_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ipv6_firewall_rules.get( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-2304", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py new file mode 100644 index 000000000000..fc6d5c05bb4f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ipv6_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ipv6_firewall_rules.list_by_server( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py new file mode 100644 index 000000000000..618a8bbe01b5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ipv6_firewall_rule_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ipv6_firewall_rules.create_or_update( + resource_group_name="firewallrulecrudtest-12", + server_name="firewallrulecrudtest-6285", + firewall_rule_name="firewallrulecrudtest-3927", + parameters={ + "properties": { + "endIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0001", + "startIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0001", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py new file mode 100644 index 000000000000..b4a0f44e5654 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ledger_digest_uploads_disable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ledger_digest_uploads.begin_disable( + resource_group_name="ledgertestrg", + server_name="ledgertestserver", + database_name="testdb", + ledger_digest_uploads="current", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py new file mode 100644 index 000000000000..9e041ac8f7d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ledger_digest_uploads_enable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ledger_digest_uploads.begin_create_or_update( + resource_group_name="ledgertestrg", + server_name="ledgertestserver", + database_name="testdb", + ledger_digest_uploads="current", + parameters={"properties": {"digestStorageEndpoint": "https://MyAccount.blob.core.windows.net"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py new file mode 100644 index 000000000000..9ce18d9956ae --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ledger_digest_uploads_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ledger_digest_uploads.get( + resource_group_name="ledgertestrg", + server_name="ledgertestserver", + database_name="testdb", + ledger_digest_uploads="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py new file mode 100644 index 000000000000..2da2c3940395 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python ledger_digest_uploads_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.ledger_digest_uploads.list_by_database( + resource_group_name="ledgertestrg", + server_name="ledgertestserver", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py deleted file mode 100644 index 64ea935ae280..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_a_job's_executions..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.list_by_job( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py deleted file mode 100644 index 67c755fe6490..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_administrators_of_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_administrators.list_by_instance( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py deleted file mode 100644 index c10e63edfefa..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_all_job_executions_in_a_job_agent..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.list_by_agent( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py deleted file mode 100644 index c1db3fedd717..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_all_job_executions_in_a_job_agent_with_filtering..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.list_by_agent( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py deleted file mode 100644 index 07836d675c50..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_all_synapselink_workspaces_for_the_given_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.synapse_link_workspaces.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="dbSynapse", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/SynapseLinkWorkspaceListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py deleted file mode 100644 index 29e0cab3ae2e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_audit_settings_of_a_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_blob_auditing_policies.list_by_database( - resource_group_name="blobauditingtest-6852", - server_name="blobauditingtest-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py deleted file mode 100644 index d5963e4fcd92..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_auditing_settings_of_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_blob_auditing_policies.list_by_server( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py deleted file mode 100644 index 057cee125203..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_credentials_in_a_job_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_credentials.list_by_agent( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py deleted file mode 100644 index 9e261877c85e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_data_masking_rules.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_masking_rules.list_by_database( - resource_group_name="sqlcrudtest-6852", - server_name="sqlcrudtest-2080", - database_name="sqlcrudtest-331", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py new file mode 100644 index 000000000000..85d3c9bf46a4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_data_warehouse_user_activities.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.data_warehouse_user_activities.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py deleted file mode 100644 index 685415384ef8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_columns.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_columns.list_by_database( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions..py deleted file mode 100644 index 390a867c25aa..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_extensions..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="7b2515fe-f230-4017-8cf0-695163acab85", - ) - - response = client.database_extensions.list_by_database( - resource_group_name="rg_4007c5a9-b3b0-41e1-bd46-9eef38768a4a", - server_name="srv_3b67ec2a-519b-43a7-8533-fb62dce3431e", - database_name="719d8fa4-bf0f-48fc-8cd3-ef40fe6ba1fe", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py new file mode 100644 index 000000000000..b5c6b76b33cb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_database_extensions.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="7b2515fe-f230-4017-8cf0-695163acab85", + ) + + response = client.database_extensions.list_by_database( + resource_group_name="rg_4007c5a9-b3b0-41e1-bd46-9eef38768a4a", + server_name="srv_3b67ec2a-519b-43a7-8533-fb62dce3431e", + database_name="719d8fa4-bf0f-48fc-8cd3-ef40fe6ba1fe", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py new file mode 100644 index 000000000000..078840b6318e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_database_operations.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.database_operations.list_by_database( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py deleted file mode 100644 index e1f06b6d98ad..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_restore_points..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.list_by_database( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - database_name="3481", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py deleted file mode 100644 index 92d004abbf09..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_schemas.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_schemas.list_by_database( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py deleted file mode 100644 index 1f5d5493e24d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_sql_vulnerability_assessment_scan_results_for_scan_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_sql_vulnerability_assessment_scan_result.list_by_scan( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="testsvr", - database_name="master", - vulnerability_assessment_name="default", - scan_id="scanId1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py deleted file mode 100644 index 4cea9acfa4f6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_tables.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_tables.list_by_schema( - resource_group_name="myRG", - server_name="serverName", - database_name="myDatabase", - schema_name="dbo", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py deleted file mode 100644 index 7779e30534d6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_database_usage_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.list_metrics( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - database_name="3481", - filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py new file mode 100644 index 000000000000..69c6a9e85c80 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_databases_by_elastic_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_by_elastic_pool( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + elastic_pool_name="pool1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListDatabasesByElasticPool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py deleted file mode 100644 index f08fcbb6d48c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_databases_by_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.list_by_instance( - resource_group_name="Test1", - managed_instance_name="managedInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseListByManagedInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py deleted file mode 100644 index a40398d73624..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_datawarehouse_database_restore_points..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restore_points.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testserver", - database_name="testDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py deleted file mode 100644 index ac6f926ea97e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_deleted_servers.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.deleted_servers.list_by_location( - location_name="japaneast", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py deleted file mode 100644 index a3fef55824e7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_deleted_servers_in_a_subscription.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.deleted_servers.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py deleted file mode 100644 index 1b4d955a4c3a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_dev_ops_audit_settings_of_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dev_ops_audit_settings.list_by_server( - resource_group_name="devAuditTestRG", - server_name="devOpsAuditTestSvr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py deleted file mode 100644 index 6649028a10c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_elastic_pool_activity.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pool_activities.list_by_elastic_pool( - resource_group_name="sqlcrudtest-4291", - server_name="sqlcrudtest-6574", - elastic_pool_name="8749", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py deleted file mode 100644 index 6feae36902c0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_elastic_pool_database_activity.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="9d4e2ad0-e20b-4464-9219-353bded52513", - ) - - response = client.elastic_pool_database_activities.list_by_elastic_pool( - resource_group_name="sqlcrudtest-4673", - server_name="sqlcrudtest-603", - elastic_pool_name="7537", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py new file mode 100644 index 000000000000..11205104afdd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_elastic_pool_operations.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.elastic_pool_operations.list_by_elastic_pool( + resource_group_name="sqlcrudtestgroup", + server_name="sqlcrudtestserver", + elastic_pool_name="testpool", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py deleted file mode 100644 index efa0dc704587..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_encryption_protectors_by_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_encryption_protectors.list_by_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py deleted file mode 100644 index b3d472a42579..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_encryption_protectors_by_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.encryption_protectors.list_by_server( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py deleted file mode 100644 index 5144308e604e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_extended_auditing_settings_of_a_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_database_blob_auditing_policies.list_by_database( - resource_group_name="blobauditingtest-6852", - server_name="blobauditingtest-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py deleted file mode 100644 index 30155fac5f70..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_extended_auditing_settings_of_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_server_blob_auditing_policies.list_by_server( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py deleted file mode 100644 index 9eceaee7e4c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.list_by_server( - resource_group_name="Default", - server_name="failover-group-primary-server", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py deleted file mode 100644 index af628124ade3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_firewall_rules.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.list_by_server( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py deleted file mode 100644 index b5b6df7ccf63..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_geo_backup_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.geo_backup_policies.list_by_database( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-5961", - database_name="testdw", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py deleted file mode 100644 index 46ddbba858b7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_inaccessible_managed_databases_by_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.list_inaccessible_by_instance( - resource_group_name="testrg", - managed_instance_name="testcl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py new file mode 100644 index 000000000000..42049efff7e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_instance_pool_usage.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.usages.list_by_instance_pool( + resource_group_name="group1", + instance_pool_name="testIP", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py new file mode 100644 index 000000000000..925f2f241a5c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_instance_pool_usage_expanded.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.usages.list_by_instance_pool( + resource_group_name="group1", + instance_pool_name="testIP", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py deleted file mode 100644 index 50096213eaac..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_instance_pool_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.usages.list_by_instance_pool( - resource_group_name="group1", - instance_pool_name="testIP", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py deleted file mode 100644 index 2cecb4fc3bd4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_instance_pool_usages_expanded_with_children..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.usages.list_by_instance_pool( - resource_group_name="group1", - instance_pool_name="testIP", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py new file mode 100644 index 000000000000..d522df008515 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_instance_pools_by_subscription_id.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py deleted file mode 100644 index c527fbffcaf6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_instance_pools_in_the_subscription.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py deleted file mode 100644 index e49523802f69..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_ipv6_firewall_rules.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ipv6_firewall_rules.list_by_server( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py new file mode 100644 index 000000000000..068aba00fac2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_agents_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_agents.list_by_server( + resource_group_name="group1", + server_name="server1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py deleted file mode 100644 index 8b39608834fd..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_job_agents_in_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_agents.list_by_server( - resource_group_name="group1", - server_name="server1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py new file mode 100644 index 000000000000..6fc02f34782c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_credentials_by_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_credentials.list_by_agent( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py new file mode 100644 index 000000000000..ad2f1ee0e4ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_execution_steps.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_step_executions.list_by_job_execution( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py new file mode 100644 index 000000000000..76c4316a0d29 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_execution_targets_by_execution.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_executions.list_by_job_execution( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py new file mode 100644 index 000000000000..077dd593bc1e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_execution_targets_by_step.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_executions.list_by_step( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + step_name="step1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py new file mode 100644 index 000000000000..0d898ccf63ae --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_executions_by_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.list_by_agent( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py new file mode 100644 index 000000000000..633d95013cf0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_executions_by_agent_with_filter.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.list_by_agent( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py new file mode 100644 index 000000000000..8d43c2f70c3b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_executions_by_job.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_executions.list_by_job( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py deleted file mode 100644 index 4debdafbc591..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_job_step_executions.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_step_executions.list_by_job_execution( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py deleted file mode 100644 index c1f6b6d53a3d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_job_step_target_executions.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_target_executions.list_by_job_execution( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py new file mode 100644 index 000000000000..91aa98ef1197 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_steps_by_job.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.list_by_job( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py new file mode 100644 index 000000000000..f7761109d049 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_steps_by_version.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_steps.list_by_version( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_version="1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py deleted file mode 100644 index 0b0284d8bd58..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_job_steps_for_the_latest_version_of_a_job..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.list_by_job( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py deleted file mode 100644 index 58dd643a0285..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_job_steps_for_the_specified_version_of_a_job..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_steps.list_by_version( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - job_version="1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py new file mode 100644 index 000000000000..a1a0122c94ef --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_target_groups.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_target_groups.list_by_agent( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py new file mode 100644 index 000000000000..d30d32008374 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_job_versions.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_versions.list_by_job( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py new file mode 100644 index 000000000000..752e525381dc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_jobs_by_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.jobs.list_by_agent( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py deleted file mode 100644 index 4540cdc4f129..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_jobs_in_a_job_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.jobs.list_by_agent( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py deleted file mode 100644 index b19f0ddc4ba7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_database_columns.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_columns.list_by_database( - resource_group_name="myRG", - managed_instance_name="serverName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py deleted file mode 100644 index 93761c9d8b62..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_database_schemas.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_schemas.list_by_database( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py deleted file mode 100644 index 2b7e4873ec8d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_database_tables.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_tables.list_by_schema( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py new file mode 100644 index 000000000000..f3446f9d75ec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_managed_instance_operations.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_operations.list_by_managed_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py deleted file mode 100644 index ab308415353d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instance_time_zones_by_location.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", - ) - - response = client.time_zones.list_by_location( - location_name="canadaeast", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py deleted file mode 100644 index ac1b879b2b2d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py deleted file mode 100644 index 4108f6dbe726..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances_by_instance_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list_by_instance_pool( - resource_group_name="Test1", - instance_pool_name="pool1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py deleted file mode 100644 index 78241b2f06b7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list_by_instance_pool( - resource_group_name="Test1", - instance_pool_name="pool1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py deleted file mode 100644 index 929ae95b267f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances_by_resource_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list_by_resource_group( - resource_group_name="Test1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py deleted file mode 100644 index e6a61939b25d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list_by_resource_group( - resource_group_name="Test1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py deleted file mode 100644 index 1aa34ee77fd9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_instances_with_$expand=administrators/activedirectory.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py deleted file mode 100644 index e55c3159c722..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_managed_server_dns_aliases.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_dns_aliases.list_by_managed_instance( - resource_group_name="Default", - managed_instance_name="dns-mi", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py deleted file mode 100644 index b84bccb83a6d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_database_advisors.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advisors.list_by_database( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py deleted file mode 100644 index 005bfed53b6c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_database_recommended_actions.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_recommended_actions.list_by_database_advisor( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - advisor_name="CreateIndex", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py deleted file mode 100644 index 809c57bef20e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_database_recommended_actions_for_all_advisors.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advisors.list_by_database( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py deleted file mode 100644 index 6b4188a68682..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_server_advisors.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advisors.list_by_server( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py deleted file mode 100644 index 3a144f88eaf2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_server_recommended_actions_for_all_advisors.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advisors.list_by_server( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py deleted file mode 100644 index 670dd6551cac..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_of_the_user_activities_of_a_data_warehouse.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.data_warehouse_user_activities.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py deleted file mode 100644 index 8fe2d8574789..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_recoverable_databases_by_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.recoverable_managed_databases.list_by_instance( - resource_group_name="Test1", - managed_instance_name="managedInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py new file mode 100644 index 000000000000..39ccbcef1eef --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_recoverable_managed_databases_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.recoverable_managed_databases.list_by_instance( + resource_group_name="Test1", + managed_instance_name="managedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py deleted file mode 100644 index 72347d02ca9c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_replication_links_on_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.list_by_server( - resource_group_name="Default", - server_name="sourcesvr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py deleted file mode 100644 index bb61e368c49d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_replication_links_on_server_on_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.list_by_database( - resource_group_name="Default", - server_name="sourcesvr", - database_name="tetha-db", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py deleted file mode 100644 index f05bb9a0fb1b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_restorable_dropped_databases_by_managed_instances.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.restorable_dropped_managed_databases.list_by_instance( - resource_group_name="Test1", - managed_instance_name="managedInstance", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py new file mode 100644 index 000000000000..aba91e284733 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_restorable_dropped_databases_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restorable_dropped_databases.list_by_server( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py deleted file mode 100644 index 929767701801..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_server_communication_links.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_communication_links.list_by_server( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py deleted file mode 100644 index ce6e442f16d6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_server_dns_aliases.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dns_aliases.list_by_server( - resource_group_name="Default", - server_name="dns-alias-server", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py new file mode 100644 index 000000000000..dcf6d922189b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_server_operations.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_operations.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py deleted file mode 100644 index 2f6d2b78f399..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_server_trust_groups.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_trust_groups.list_by_location( - resource_group_name="Default", - location_name="Japan East", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py deleted file mode 100644 index 6b75f5a32b1c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_server_trust_groups_by_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_trust_groups.list_by_instance( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance-1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py deleted file mode 100644 index cceb60af8e97..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_servers.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py deleted file mode 100644 index 16a29225774a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_servers_by_resource_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.list_by_resource_group( - resource_group_name="sqlcrudtest-7398", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py deleted file mode 100644 index 854015e9bf9b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_servers_by_resource_group_with_$expand=administrators.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.list_by_resource_group( - resource_group_name="sqlcrudtest-7398", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py deleted file mode 100644 index 21788278b1af..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_servers_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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_usages.list_by_server( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py deleted file mode 100644 index f821ad93794c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_servers_with_expand_equals_administrators.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListWithExpandEqualsAdministrators.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py deleted file mode 100644 index cf0fd5215588..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_service_objectives.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.service_objectives.list_by_server( - resource_group_name="group1", - server_name="sqlcrudtest", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py new file mode 100644 index 000000000000..15df3fdd5bdb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_short_term_retention_policies_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.backup_short_term_retention_policies.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py deleted file mode 100644 index 14e0d1d544e0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_subscription_capabilities_in_the_given_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.capabilities.list_by_location( - location_name="eastus", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py deleted file mode 100644 index 25fd5ca77ae2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_subscription_usages_in_the_given_location..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.subscription_usages.list_by_location( - location_name="WestUS", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py deleted file mode 100644 index 9c8a4add493a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_sync_groups_under_a_given_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.list_by_database( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py deleted file mode 100644 index b9f5ae4d4af6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_sync_members_under_a_sync_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.list_by_sync_group( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py deleted file mode 100644 index 78ac0692bcf9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessment_scan_result.list_by_scan( - resource_group_name="vulnerabilityassessmenttest-4711", - server_name="testsvr", - vulnerability_assessment_name="default", - scan_id="scanId1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py deleted file mode 100644 index 8147747229c0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_database_management_operations.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_operations.list_by_database( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py deleted file mode 100644 index e4392402cdee..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_elastic_pool_management_operations.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pool_operations.list_by_elastic_pool( - resource_group_name="sqlcrudtestgroup", - server_name="sqlcrudtestserver", - elastic_pool_name="testpool", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py deleted file mode 100644 index f54c3fd95370..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_keys_for_a_managed_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_keys.list_by_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py deleted file mode 100644 index e2977c8eb9bb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_managed_instance's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_advanced_threat_protection_settings.list_by_instance( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py deleted file mode 100644 index 6c4ffe22f4a9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_managed_instance_management_operations.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_operations.list_by_managed_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py deleted file mode 100644 index 4692fd3c4ba2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_server's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advanced_threat_protection_settings.list_by_server( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py deleted file mode 100644 index cfb574ba7435..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_server's_threat_detection_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_security_alert_policies.list_by_server( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py deleted file mode 100644 index e3b2330a68e5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_server_keys_by_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_keys.list_by_server( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py deleted file mode 100644 index 130275dcc6fc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_the_server_management_operations.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_operations.list_by_server( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py new file mode 100644 index 000000000000..df25e77370db --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_vcore_databases_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_by_server( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListVCoreDatabasesByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py new file mode 100644 index 000000000000..398e9c1d61f2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_vcore_databases_enclave_type_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_by_server( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py new file mode 100644 index 000000000000..d2179ce18012 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_vcore_inaccessible_databases_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_inaccessible_by_server( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py deleted file mode 100644 index 73a8afa3d97a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_virtual_clusters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.virtual_clusters.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py deleted file mode 100644 index 1f1b819b91d6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_virtual_clusters_by_resource_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.virtual_clusters.list_by_resource_group( - resource_group_name="testrg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py deleted file mode 100644 index eefb512a1706..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python list_virtual_network_rules.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.virtual_network_rules.list_by_server( - resource_group_name="Default", - server_name="vnet-test-svr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py deleted file mode 100644 index e4adbdf79e76..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python lists_a_servers_connection_policies.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_connection_policies.list_by_server( - resource_group_name="rgtest-12", - server_name="servertest-6285", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py deleted file mode 100644 index 3c1c04cf6a77..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python lists_all_distributed_availability_groups_in_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.distributed_availability_groups.list_by_instance( - resource_group_name="testrg", - managed_instance_name="testcl", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py deleted file mode 100644 index 236c28eb22ce..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python lists_the_database's_advanced_threat_protection_settings..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advanced_threat_protection_settings.list_by_database( - resource_group_name="threatprotection-6852", - server_name="threatprotection-2080", - database_name="testdb", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py new file mode 100644 index 000000000000..06c607b4b823 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py @@ -0,0 +1,40 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python location_capability_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.capabilities.list_by_location( + location_name="eastus", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py new file mode 100644 index 000000000000..3ce178f89563 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_copy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_copy( + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={ + "properties": { + "targetBackupStorageRedundancy": "Geo", + "targetDatabaseName": "testDatabase2", + "targetServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py new file mode 100644 index 000000000000..d9ff78a5b66f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_delete( + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py new file mode 100644 index 000000000000..a79f1edc9af7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.get( + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py new file mode 100644 index 000000000000..d141a35afc39 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_database( + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py new file mode 100644 index 000000000000..cb43db8273ce --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_location( + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py new file mode 100644 index 000000000000..273c27d28c0a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_server( + location_name="japaneast", + long_term_retention_server_name="testserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py new file mode 100644 index 000000000000..de1bf1e63641 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_backup_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_update( + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={"properties": {"requestedBackupStorageRedundancy": "Geo"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py new file mode 100644 index 000000000000..7630f27b819d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_policy_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + server_name="testserver", + database_name="testDatabase", + policy_name="default", + parameters={ + "properties": { + "monthlyRetention": "P1Y", + "weekOfYear": 5, + "weeklyRetention": "P1M", + "yearlyRetention": "P5Y", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py new file mode 100644 index 000000000000..4cf433ca2297 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_policy_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_policies.get( + resource_group_name="resourceGroup", + server_name="testserver", + database_name="testDatabase", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py new file mode 100644 index 000000000000..943ff1076761 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python long_term_retention_policy_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_policies.list_by_database( + resource_group_name="resourceGroup", + server_name="testserver", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py new file mode 100644 index 000000000000..463d519330a9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_columns_list_by_database_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_columns.list_by_database( + resource_group_name="myRG", + managed_instance_name="serverName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py new file mode 100644 index 000000000000..519f4a75da2f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_columns_list_by_database_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_columns.list_by_database( + resource_group_name="myRG", + managed_instance_name="serverName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py new file mode 100644 index 000000000000..8902e446789f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_advanced_threat_protection_settings_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_advanced_threat_protection_settings.create_or_update( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + database_name="testdb", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py new file mode 100644 index 000000000000..25156e132d98 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_advanced_threat_protection_settings_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_advanced_threat_protection_settings.create_or_update( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + database_name="testdb", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Disabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py new file mode 100644 index 000000000000..c470028291de --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_advanced_threat_protection_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_advanced_threat_protection_settings.get( + resource_group_name="threatprotection-6852", + managed_instance_name="threatprotection-2080", + database_name="testdb", + advanced_threat_protection_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py new file mode 100644 index 000000000000..979cefc81963 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_advanced_threat_protection_settings_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_advanced_threat_protection_settings.list_by_database( + resource_group_name="threatprotection-6852", + managed_instance_name="threatprotection-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py new file mode 100644 index 000000000000..e0343c50b0a8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_cancel_move.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_cancel_move( + resource_group_name="group1", + managed_instance_name="testInstanceSrc", + database_name="testDatabase", + parameters={ + "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCancelMove.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py new file mode 100644 index 000000000000..c637602e7acc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_column_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_columns.get( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + column_name="column1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py new file mode 100644 index 000000000000..7c205120a9da --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_column_list_by_table.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_columns.list_by_table( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py new file mode 100644 index 000000000000..cac7da24ecba --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_column_sensitivity_label_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.create_or_update( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + parameters={ + "properties": { + "informationType": "PhoneNumber", + "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", + "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", + "labelName": "PII", + "rank": "High", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py new file mode 100644 index 000000000000..be580835629b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_column_sensitivity_label_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.delete( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py new file mode 100644 index 000000000000..f03ddf6c4404 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_column_sensitivity_label_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.get( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + sensitivity_label_source="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py new file mode 100644 index 000000000000..b7020b68fab4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_complete_external_restore.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_complete_restore( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + parameters={"lastBackupName": "testdb1_log4"}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py new file mode 100644 index 000000000000..41dc13b8edcd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_complete_move.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_complete_move( + resource_group_name="group1", + managed_instance_name="testInstanceSrc", + database_name="testDatabase", + parameters={ + "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCompleteMove.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py new file mode 100644 index 000000000000..6cfa6253181d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={"location": "southeastasia", "tags": {"tagKey1": "TagValue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py new file mode 100644 index 000000000000..a06d94ddc813 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={"location": "southeastasia"}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py new file mode 100644 index 000000000000..e6df86b7814d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_point_in_time_restore.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "PointInTimeRestore", + "restorePointInTime": "2017-07-14T05:35:31.503Z", + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py new file mode 100644 index 000000000000..83e63fc35cb5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_recovery.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="server1", + database_name="testdb_recovered", + parameters={ + "location": "southeastasia", + "properties": { + "createMode": "Recovery", + "recoverableDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRecovery.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py new file mode 100644 index 000000000000..8c4aae7e560b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_restore_external_backup.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={ + "location": "southeastasia", + "properties": { + "autoCompleteRestore": True, + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "RestoreExternalBackup", + "lastBackupName": "last_backup_name", + "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234", + "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py new file mode 100644 index 000000000000..0dade6849425 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_restore_external_backup_managed_identity.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={ + "location": "southeastasia", + "properties": { + "autoCompleteRestore": True, + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "RestoreExternalBackup", + "lastBackupName": "last_backup_name", + "storageContainerIdentity": "ManagedIdentity", + "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py new file mode 100644 index 000000000000..7e6b263b0385 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_create_restore_ltr_backup.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="managedDatabase", + parameters={ + "location": "southeastasia", + "properties": { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "RestoreExternalBackup", + "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234", + "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py new file mode 100644 index 000000000000..d4e2787a4f0e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="testdb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py new file mode 100644 index 000000000000..d7c17c0b9b91 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.get( + resource_group_name="Test1", + managed_instance_name="managedInstance", + database_name="managedDatabase", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py new file mode 100644 index 000000000000..523abc36e32f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_list_by_managed_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.list_by_instance( + resource_group_name="Test1", + managed_instance_name="managedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseListByManagedInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py new file mode 100644 index 000000000000..b5d3aff33840 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_move_operation_result_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_move_operations.get( + resource_group_name="rg1", + location_name="westeurope", + operation_id="15961324-d809-46ed-86b9-d786953140e2", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py new file mode 100644 index 000000000000..84ddba0d73c1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_move_operation_result_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_move_operations.list_by_location( + resource_group_name="rg1", + location_name="westeurope", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py new file mode 100644 index 000000000000..8fcfc11cceb0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_move_operation_result_list_last_operations.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_move_operations.list_by_location( + resource_group_name="rg1", + location_name="westeurope", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListLastOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py new file mode 100644 index 000000000000..2154763ffa41 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_move_operation_result_list_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_move_operations.list_by_location( + resource_group_name="rg1", + location_name="westeurope", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py new file mode 100644 index 000000000000..7e0eddb653d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_recommended_column_sensitivity_label_disable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.disable_recommendation( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py new file mode 100644 index 000000000000..91f9169d6347 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_recommended_column_sensitivity_label_enable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.enable_recommendation( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details..py deleted file mode 100644 index b409056d61c0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python managed_database_restore_details..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_restore_details.get( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="testdb", - restore_details_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseRestoreDetails.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py new file mode 100644 index 000000000000..8be0c2f575e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_restore_details.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_restore_details.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="testdb", + restore_details_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseRestoreDetails.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py new file mode 100644 index 000000000000..408d38bb55e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_schema_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_schemas.get( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py new file mode 100644 index 000000000000..2700a5cf5863 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_schema_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_schemas.list_by_database( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py new file mode 100644 index 000000000000..77aa6402b5ea --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_alert_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_alert_policies.create_or_update( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + database_name="testdb", + security_alert_policy_name="Default", + parameters={ + "properties": { + "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], + "emailAccountAdmins": True, + "emailAddresses": ["test@contoso.com", "user@contoso.com"], + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py new file mode 100644 index 000000000000..76421da784a2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_alert_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_alert_policies.create_or_update( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + database_name="testdb", + security_alert_policy_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py new file mode 100644 index 000000000000..8d52e21ef080 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_alert_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_alert_policies.get( + resource_group_name="securityalert-6852", + managed_instance_name="securityalert-2080", + database_name="testdb", + security_alert_policy_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py new file mode 100644 index 000000000000..df8ef0b51f96 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_alert_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_alert_policies.list_by_database( + resource_group_name="securityalert-6852", + managed_instance_name="securityalert-2080", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py new file mode 100644 index 000000000000..c04a72c5a5fe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_events_get_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_events.list_by_database( + resource_group_name="testrg", + managed_instance_name="testcl", + database_name="database1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py new file mode 100644 index 000000000000..54147e6e57e9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_security_events_get_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_security_events.list_by_database( + resource_group_name="testrg", + managed_instance_name="testcl", + database_name="database1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py new file mode 100644 index 000000000000..aaf5fd7876fb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py @@ -0,0 +1,79 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_sensitivity_labels_current_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.update( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + parameters={ + "operations": [ + { + "properties": { + "column": "column1", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "Financial", + "informationTypeId": "1D3652D6-422C-4115-82F1-65DAEBC665C8", + "labelId": "3A477B16-9423-432B-AA97-6069B481CEC3", + "labelName": "Highly Confidential", + } + }, + "table": "table1", + } + }, + { + "properties": { + "column": "column2", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "PhoneNumber", + "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", + "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", + "labelName": "PII", + } + }, + "table": "table2", + } + }, + {"properties": {"column": "Column3", "op": "remove", "schema": "dbo", "table": "Table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py new file mode 100644 index 000000000000..147f121a38ec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_sensitivity_labels_list_by_database_current.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.list_current_by_database( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py new file mode 100644 index 000000000000..95bcfd87e53c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_sensitivity_labels_list_by_database_recommended.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_sensitivity_labels.list_recommended_by_database( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py new file mode 100644 index 000000000000..5d298ccdca88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_sensitivity_labels_recommended_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_recommended_sensitivity_labels.update( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + parameters={ + "operations": [ + {"properties": {"column": "column1", "op": "enable", "schema": "dbo", "table": "table1"}}, + {"properties": {"column": "column2", "op": "disable", "schema": "dbo", "table": "table2"}}, + {"properties": {"column": "Column3", "op": "disable", "schema": "dbo", "table": "Table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py new file mode 100644 index 000000000000..68ff235d90b3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_start_move_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_start_move( + resource_group_name="group1", + managed_instance_name="testInstanceSrc", + database_name="testDatabase", + parameters={ + "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase", + "operationMode": "Copy", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseStartMoveMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py new file mode 100644 index 000000000000..e4185ac0f8e4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_start_move_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_start_move( + resource_group_name="group1", + managed_instance_name="testInstanceSrc", + database_name="testDatabase", + parameters={ + "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseStartMoveMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py new file mode 100644 index 000000000000..ff6ad300d51a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_table_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_tables.get( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py new file mode 100644 index 000000000000..22cb4f7a9cfe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_table_list_by_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_tables.list_by_schema( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py new file mode 100644 index 000000000000..e7f85f583f88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="testdb", + parameters={"tags": {"tagKey1": "TagValue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py new file mode 100644 index 000000000000..8d743648233e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + database_name="testdb", + parameters={"tags": {"tagKey1": "TagValue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py new file mode 100644 index 000000000000..56eb5ef61597 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "recurringScans": { + "emailSubscriptionAdmins": True, + "emails": ["email1@mail.com", "email2@mail.com"], + "isEnabled": True, + }, + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py new file mode 100644 index 000000000000..b7af7e0fb0bb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py new file mode 100644 index 000000000000..33be4404e456 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py new file mode 100644 index 000000000000..01df21238fb2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessments.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py new file mode 100644 index 000000000000..43b6b024b7f3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessments.list_by_database( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py new file mode 100644 index 000000000000..e8ee07e1a814 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_rule_baseline_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_rule_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + parameters={ + "properties": { + "baselineResults": [ + {"result": ["userA", "SELECT"]}, + {"result": ["userB", "SELECT"]}, + {"result": ["userC", "SELECT", "tableId_4"]}, + ] + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py new file mode 100644 index 000000000000..075cb14470b5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py new file mode 100644 index 000000000000..c9aae54fb5af --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_rule_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + managed_instance_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="master", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py new file mode 100644 index 000000000000..47a40871e64a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_scan_export.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_scans.export( + resource_group_name="vulnerabilityassessmenttest-4799", + managed_instance_name="vulnerabilityassessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py new file mode 100644 index 000000000000..c918249e0f92 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_scan_records_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_scans.get( + resource_group_name="vulnerabilityassessmenttest-4711", + managed_instance_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py new file mode 100644 index 000000000000..a8091b377ec5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_scan_records_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_scans.list_by_database( + resource_group_name="vulnerabilityassessmenttest-4711", + managed_instance_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py new file mode 100644 index 000000000000..cc2ccb0a1147 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_database_vulnerability_assessment_scans_execute.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( + resource_group_name="vulnerabilityassessmenttest-4711", + managed_instance_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan01", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py new file mode 100644 index 000000000000..aa981e0be106 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_administrator_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_administrators.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + administrator_name="ActiveDirectory", + parameters={ + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "44444444-3333-2222-1111-000000000000", + "tenantId": "55555555-4444-3333-2222-111111111111", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py new file mode 100644 index 000000000000..48581ce4a599 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_administrator_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_administrators.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + administrator_name="ActiveDirectory", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py new file mode 100644 index 000000000000..faa32ffe8665 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_administrator_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_administrators.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + administrator_name="ActiveDirectory", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py new file mode 100644 index 000000000000..b61258c1e8b0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_administrator_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_administrators.list_by_instance( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py new file mode 100644 index 000000000000..e41ad6a360b0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_administrator_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_administrators.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + administrator_name="ActiveDirectory", + parameters={ + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "44444444-3333-2222-1111-000000000000", + "tenantId": "55555555-4444-3333-2222-111111111111", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py new file mode 100644 index 000000000000..321fdd3788ca --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_advanced_threat_protection_settings_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py new file mode 100644 index 000000000000..275c31b12013 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_advanced_threat_protection_settings_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py new file mode 100644 index 000000000000..49fb369db227 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_advanced_threat_protection_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_advanced_threat_protection_settings.get( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + advanced_threat_protection_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py new file mode 100644 index 000000000000..867a5f76c4cf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_advanced_threat_protection_settings_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_advanced_threat_protection_settings.list_by_instance( + resource_group_name="threatprotection-4799", + managed_instance_name="threatprotection-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py new file mode 100644 index 000000000000..690bbfaff007 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_azure_ad_only_auth_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_azure_ad_only_authentications.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + authentication_name="Default", + parameters={"properties": {"azureADOnlyAuthentication": False}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py new file mode 100644 index 000000000000..c9a4656700be --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_azure_ad_only_auth_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_azure_ad_only_authentications.begin_delete( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + authentication_name="Default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py new file mode 100644 index 000000000000..cc6a5e978df6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_azure_ad_only_auth_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_azure_ad_only_authentications.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + authentication_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py new file mode 100644 index 000000000000..6474dee08898 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_azure_ad_only_auth_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_azure_ad_only_authentications.list_by_instance( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py new file mode 100644 index 000000000000..5605fb8e6b74 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py @@ -0,0 +1,71 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={ + "location": "Japan East", + "properties": { + "administratorLogin": "dummylogin", + "administratorLoginPassword": "PLACEHOLDER", + "administrators": { + "azureADOnlyAuthentication": True, + "login": "bob@contoso.com", + "principalType": "User", + "sid": "00000011-1111-2222-2222-123456789111", + "tenantId": "00000011-1111-2222-2222-123456789111", + }, + "collation": "SQL_Latin1_General_CP1_CI_AS", + "dnsZonePartner": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance", + "instancePoolId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1", + "licenseType": "LicenseIncluded", + "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", + "minimalTlsVersion": "1.2", + "proxyOverride": "Redirect", + "publicDataEndpointEnabled": False, + "requestedBackupStorageRedundancy": "Geo", + "servicePrincipal": {"type": "SystemAssigned"}, + "storageSizeInGB": 1024, + "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "timezoneId": "UTC", + "vCores": 8, + }, + "sku": {"name": "GP_Gen5", "tier": "GeneralPurpose"}, + "tags": {"tagKey1": "TagValue1"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py new file mode 100644 index 000000000000..61cb60c287fd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={ + "location": "Japan East", + "properties": { + "administratorLogin": "dummylogin", + "administratorLoginPassword": "PLACEHOLDER", + "licenseType": "LicenseIncluded", + "storageSizeInGB": 1024, + "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "vCores": 8, + }, + "sku": {"name": "GP_Gen4", "tier": "GeneralPurpose"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py new file mode 100644 index 000000000000..e1f680402704 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_delete( + resource_group_name="testrg", + managed_instance_name="testinstance", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py new file mode 100644 index 000000000000..fbb0d0e45c17 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_dtc_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_dtcs.get( + resource_group_name="testrg", + managed_instance_name="testinstance", + dtc_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py new file mode 100644 index 000000000000..2475b33068ce --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_dtc_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_dtcs.list_by_managed_instance( + resource_group_name="testrg", + managed_instance_name="testinstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py new file mode 100644 index 000000000000..4637c61cc93b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_dtc_update_enable_dtc.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_dtcs.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + dtc_name="current", + parameters={"properties": {"dtcEnabled": True}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateEnableDtc.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py new file mode 100644 index 000000000000..8546f1030713 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py @@ -0,0 +1,59 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_dtc_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_dtcs.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + dtc_name="current", + parameters={ + "properties": { + "dtcEnabled": True, + "externalDnsSuffixSearchList": ["dns.example1.com", "dns.example2.com"], + "securitySettings": { + "snaLu6point2TransactionsEnabled": False, + "transactionManagerCommunicationSettings": { + "allowInboundEnabled": False, + "allowOutboundEnabled": True, + "authentication": "NoAuth", + }, + "xaTransactionsDefaultTimeout": 1000, + "xaTransactionsEnabled": False, + "xaTransactionsMaximumTimeout": 3000, + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py new file mode 100644 index 000000000000..6badd6536128 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_encryption_protector_create_or_update_key_vault.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={ + "properties": { + "autoRotationEnabled": False, + "serverKeyName": "someVault_someKey_01234567890123456789012345678901", + "serverKeyType": "AzureKeyVault", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py new file mode 100644 index 000000000000..c2215c5e1941 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_encryption_protector_create_or_update_service_managed.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={"properties": {"serverKeyName": "ServiceManaged", "serverKeyType": "ServiceManaged"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py new file mode 100644 index 000000000000..6350fa9a5d5f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_encryption_protector_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_encryption_protectors.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py new file mode 100644 index 000000000000..feb2633bf0ac --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_encryption_protector_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_encryption_protectors.list_by_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py new file mode 100644 index 000000000000..58ac0bfe8a91 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_encryption_protector_revalidate.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_encryption_protectors.begin_revalidate( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py new file mode 100644 index 000000000000..5a5252298f1f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.managed_instances.get( + resource_group_name="testrg", + managed_instance_name="testinstance", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py new file mode 100644 index 000000000000..17c325dddad2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_get_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.managed_instances.get( + resource_group_name="testrg", + managed_instance_name="testinstance", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py new file mode 100644 index 000000000000..22b749aa344e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_key_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_keys.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + parameters={ + "properties": { + "serverKeyType": "AzureKeyVault", + "uri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py new file mode 100644 index 000000000000..00212ac55852 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_key_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_keys.begin_delete( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py new file mode 100644 index 000000000000..9209545ccebe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_keys.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py new file mode 100644 index 000000000000..c2d32974e425 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_key_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_keys.list_by_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py new file mode 100644 index 000000000000..c50f5ce77da5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py new file mode 100644 index 000000000000..7cfa8dc84e40 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_list_by_instance_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list_by_instance_pool( + resource_group_name="Test1", + instance_pool_name="pool1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py new file mode 100644 index 000000000000..1a66e87bc905 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_list_by_instance_pool_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list_by_instance_pool( + resource_group_name="Test1", + instance_pool_name="pool1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py new file mode 100644 index 000000000000..48f0082fd8a1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_list_by_resource_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list_by_resource_group( + resource_group_name="Test1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py new file mode 100644 index 000000000000..1360a6d44cd6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_list_by_resource_group_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list_by_resource_group( + resource_group_name="Test1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py new file mode 100644 index 000000000000..0a81cbaae679 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_list_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py new file mode 100644 index 000000000000..31f8f5e4e66c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.begin_delete( + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py new file mode 100644 index 000000000000..d5221425b6b7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.get( + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py new file mode 100644 index 000000000000..431e6db4ec91 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_backup_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_database( + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py new file mode 100644 index 000000000000..4413c8444018 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_backup_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_instance( + location_name="japaneast", + managed_instance_name="testInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py new file mode 100644 index 000000000000..ba7c01d3b31a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_backup_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_location( + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py new file mode 100644 index 000000000000..2c4f1258d95a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_policy_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_long_term_retention_policies.begin_create_or_update( + resource_group_name="testResourceGroup", + managed_instance_name="testInstance", + database_name="testDatabase", + policy_name="default", + parameters={ + "properties": { + "monthlyRetention": "P1Y", + "weekOfYear": 5, + "weeklyRetention": "P1M", + "yearlyRetention": "P5Y", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py new file mode 100644 index 000000000000..ca162da49d28 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_policy_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_long_term_retention_policies.get( + resource_group_name="testResourceGroup", + managed_instance_name="testInstance", + database_name="testDatabase", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py new file mode 100644 index 000000000000..e12106e9ef37 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_long_term_retention_policy_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_long_term_retention_policies.list_by_database( + resource_group_name="testResourceGroup", + managed_instance_name="testInstance", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py new file mode 100644 index 000000000000..f2b69934688e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_endpoint_connections.begin_delete( + resource_group_name="Default", + managed_instance_name="test-cl", + private_endpoint_connection_name="private-endpoint-connection-name", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py new file mode 100644 index 000000000000..cd1f4c4ed109 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_endpoint_connections.get( + resource_group_name="Default", + managed_instance_name="test-cl", + private_endpoint_connection_name="private-endpoint-connection-name", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py new file mode 100644 index 000000000000..020344fabf39 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_private_endpoint_connection_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_endpoint_connections.list_by_managed_instance( + resource_group_name="Default", + managed_instance_name="test-cl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py new file mode 100644 index 000000000000..75b64727e82e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_endpoint_connections.begin_create_or_update( + resource_group_name="Default", + managed_instance_name="test-cl", + private_endpoint_connection_name="private-endpoint-connection-name", + parameters={ + "properties": { + "privateLinkServiceConnectionState": { + "description": "Approved by johndoe@contoso.com", + "status": "Approved", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py new file mode 100644 index 000000000000..3116d6dc76e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_private_link_resources_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_link_resources.get( + resource_group_name="Default", + managed_instance_name="test-cl", + group_name="plr", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py new file mode 100644 index 000000000000..36a27f4fc155 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_private_link_resources_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_private_link_resources.list_by_managed_instance( + resource_group_name="Default", + managed_instance_name="test-cl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py new file mode 100644 index 000000000000..b870a911d95c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_query_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_queries.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + database_name="database_1", + query_id="42", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py new file mode 100644 index 000000000000..df30a622451d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_query_statistics_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_queries.list_by_query( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + database_name="database_1", + query_id="42", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py new file mode 100644 index 000000000000..68f586d8cb95 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_query_statistics_list_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_queries.list_by_query( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + database_name="database_1", + query_id="42", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py new file mode 100644 index 000000000000..43c6ffab58ed --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_query_statistics_list_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_queries.list_by_query( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + database_name="database_1", + query_id="42", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py new file mode 100644 index 000000000000..55018e729a9a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_remove_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={ + "properties": { + "maintenanceConfigurationId": "/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py new file mode 100644 index 000000000000..33f0d11ae0c4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_tde_certificate.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000001", + ) + + response = client.managed_instance_tde_certificates.begin_create( + resource_group_name="testtdecert", + managed_instance_name="testtdecert", + parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py new file mode 100644 index 000000000000..44db1246f413 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_time_zone_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", + ) + + response = client.time_zones.get( + location_name="canadaeast", + time_zone_id="Haiti Standard Time", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py new file mode 100644 index 000000000000..768e4db45fb0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_time_zone_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", + ) + + response = client.time_zones.list_by_location( + location_name="canadaeast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py new file mode 100644 index 000000000000..5d45b8bdc2bf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_top_queries_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instances.list_by_managed_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py new file mode 100644 index 000000000000..e2ad638ed9a8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_top_queries_list_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instances.list_by_managed_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py new file mode 100644 index 000000000000..5513025b7386 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_top_queries_list_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instances.list_by_managed_instance( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py new file mode 100644 index 000000000000..236fef388cd2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py @@ -0,0 +1,58 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={ + "properties": { + "administratorLogin": "dummylogin", + "administratorLoginPassword": "PLACEHOLDER", + "collation": "SQL_Latin1_General_CP1_CI_AS", + "licenseType": "BasePrice", + "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", + "minimalTlsVersion": "1.2", + "proxyOverride": "Redirect", + "publicDataEndpointEnabled": False, + "requestedBackupStorageRedundancy": "Geo", + "storageSizeInGB": 448, + "vCores": 8, + }, + "sku": {"capacity": 8, "name": "GP_Gen4", "tier": "GeneralPurpose"}, + "tags": {"tagKey1": "TagValue1"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py new file mode 100644 index 000000000000..a310e6ea7654 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + ) + + response = client.managed_instances.begin_update( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={"tags": {"tagKey1": "TagValue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py new file mode 100644 index 000000000000..b39d923ba372 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_create_container_sas_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py new file mode 100644 index 000000000000..e31e7ddd2814 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "recurringScans": { + "emailSubscriptionAdmins": True, + "emails": ["email1@mail.com", "email2@mail.com"], + "isEnabled": True, + }, + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py new file mode 100644 index 000000000000..7549d810eff0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_create_storage_access_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py new file mode 100644 index 000000000000..0bd29afdeec7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py new file mode 100644 index 000000000000..7ef1dfc3b97a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py new file mode 100644 index 000000000000..ef52c120c721 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_instance_vulnerability_assessment_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_instance_vulnerability_assessments.list_by_instance( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py new file mode 100644 index 000000000000..eeb3fc5dd675 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_dns_alias_acquire.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_dns_aliases.begin_acquire( + resource_group_name="Default", + managed_instance_name="new-mi", + dns_alias_name="dns-alias-mi", + parameters={ + "oldManagedServerDnsAliasResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/old-mi/dnsAliases/alias1" + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasAcquire.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py new file mode 100644 index 000000000000..67151e54722c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_dns_aliases.begin_delete( + resource_group_name="Default", + managed_instance_name="dns-mi", + dns_alias_name="dns-alias-mi", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py new file mode 100644 index 000000000000..3fad1ed7d039 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_dns_aliases.get( + resource_group_name="Default", + managed_instance_name="dns-mi", + dns_alias_name="dns-alias-mi", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py new file mode 100644 index 000000000000..3194c3187813 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_dns_aliases.list_by_managed_instance( + resource_group_name="Default", + managed_instance_name="dns-mi", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py new file mode 100644 index 000000000000..43ec17281379 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_security_alert_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_security_alert_policies.begin_create_or_update( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + security_alert_policy_name="Default", + parameters={ + "properties": { + "disabledAlerts": ["Access_Anomaly", "Usage_Anomaly"], + "emailAccountAdmins": True, + "emailAddresses": ["testSecurityAlert@microsoft.com"], + "retentionDays": 5, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py new file mode 100644 index 000000000000..ca23c3085148 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_security_alert_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_security_alert_policies.begin_create_or_update( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + security_alert_policy_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py new file mode 100644 index 000000000000..a58cdb86721c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_security_alert_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_security_alert_policies.get( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + security_alert_policy_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py new file mode 100644 index 000000000000..fe102b893551 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_server_security_alert_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_server_security_alert_policies.list_by_instance( + resource_group_name="securityalert-4799", + managed_instance_name="securityalert-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py new file mode 100644 index 000000000000..be16b3a27a75 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_transparent_data_encryption_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_transparent_data_encryption.get( + resource_group_name="security-tde-resourcegroup", + managed_instance_name="securitytde", + database_name="testdb", + tde_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py new file mode 100644 index 000000000000..6a9e78ae1bd8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_transparent_data_encryption_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_transparent_data_encryption.list_by_database( + resource_group_name="security-tde-resourcegroup", + managed_instance_name="securitytde", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py new file mode 100644 index 000000000000..29d8e871e224 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python managed_transparent_data_encryption_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_database_transparent_data_encryption.create_or_update( + resource_group_name="securitytde-42-rg", + managed_instance_name="securitytde-42", + database_name="testdb", + tde_name="current", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py deleted file mode 100644 index e86449f3715d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_list_of_instance's_top_resource_consuming_queries..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.list_by_managed_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py deleted file mode 100644 index 733ead4b4abc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.list_by_managed_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py deleted file mode 100644 index 11b5d9cfeeab..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instances.list_by_managed_instance( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py deleted file mode 100644 index 36e6117737b1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_query_execution_statistics._example_with_all_request_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_queries.list_by_query( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - database_name="database_1", - query_id="42", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py deleted file mode 100644 index b3daccd0c5b5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_queries.list_by_query( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - database_name="database_1", - query_id="42", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py deleted file mode 100644 index 80e6dd6ff6f0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_query_execution_statistics.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_queries.list_by_query( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - database_name="database_1", - query_id="42", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py deleted file mode 100644 index 6c5ec0f74bef..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python obtain_query_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_queries.get( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - database_name="database_1", - query_id="42", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py new file mode 100644 index 000000000000..580f103275a5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python outbound_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.outbound_firewall_rules.begin_delete( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-6661", + outbound_rule_fqdn="server.database.windows.net", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py new file mode 100644 index 000000000000..5d6aafe2ea61 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python outbound_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.outbound_firewall_rules.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + outbound_rule_fqdn="server.database.windows.net", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py new file mode 100644 index 000000000000..6e5274410b84 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python outbound_firewall_rule_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.outbound_firewall_rules.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py deleted file mode 100644 index 1f9448796afe..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python patch_an_instance_pool.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.instance_pools.begin_update( - resource_group_name="group1", - instance_pool_name="testIP", - parameters={"tags": {"x": "y"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py new file mode 100644 index 000000000000..e1458f65ed2b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_database_default_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"properties": {"preferredEnclaveType": "Default"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchDatabaseDefaultEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py new file mode 100644 index 000000000000..d57219dfd6d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_database_vbs_enclave.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"properties": {"preferredEnclaveType": "VBS"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py new file mode 100644 index 000000000000..856593c9ffec --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_instance_pool.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_pools.begin_update( + resource_group_name="group1", + instance_pool_name="testIP", + parameters={"tags": {"x": "y"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py new file mode 100644 index 000000000000..d13cf6e236b5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_vcore_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "properties": {"licenseType": "LicenseIncluded", "maxSizeBytes": 1073741824}, + "sku": {"name": "BC_Gen4_4"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py new file mode 100644 index 000000000000..5cf255aa8790 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_vcore_database_assign_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "properties": { + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1" + }, + "sku": {"name": "BC_Gen5_4"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py new file mode 100644 index 000000000000..9dfc4bc24738 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python patch_vcore_database_reset_maintenance_configuration.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "properties": { + "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" + }, + "sku": {"name": "BC_Gen5_4"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py new file mode 100644 index 000000000000..fd25770a390e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python pause_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_pause( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdwdb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PauseDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py deleted file mode 100644 index 6c463046719a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python pauses_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_pause( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdwdb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PauseDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py deleted file mode 100644 index c7366d7e774b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python performs_update_of_dns_servers_on_managed_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.virtual_clusters.begin_update_dns_servers( - resource_group_name="sqlcrudtest-7398", - virtual_cluster_name="VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpdateVirtualClusterDnsServers.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py deleted file mode 100644 index c4cc60f62448..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python planned_failover_of_a_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.begin_failover( - resource_group_name="Default", - server_name="failover-group-secondary-server", - failover_group_name="failover-group-test-3", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py deleted file mode 100644 index 131295b30cef..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python planned_failover_of_a_replication_link.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.replication_links.begin_failover( - resource_group_name="Default", - server_name="sourcesvr", - database_name="gamma-db", - link_id="4891ca10-ebd0-47d7-9182-c722651780fb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py new file mode 100644 index 000000000000..3917f9646351 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python 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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.begin_delete( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py new file mode 100644 index 000000000000..bb4cce4cc496 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.get( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py new file mode 100644 index 000000000000..b0d9735dc51e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python private_endpoint_connection_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.list_by_server( + resource_group_name="Default", + server_name="test-svr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py new file mode 100644 index 000000000000..d6e27e2c6a88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python 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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.begin_create_or_update( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + parameters={ + "properties": { + "privateLinkServiceConnectionState": { + "description": "Approved by johndoe@contoso.com", + "status": "Approved", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py new file mode 100644 index 000000000000..b8d8643db3ab --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python private_link_resources_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.get( + resource_group_name="Default", + server_name="test-svr", + group_name="plr", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py new file mode 100644 index 000000000000..24335380ab56 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python private_link_resources_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.list_by_server( + resource_group_name="Default", + server_name="test-svr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py deleted file mode 100644 index a80628387657..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python puts_new_sql_agent_configuration_to_instance..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_agent.create_or_update( - resource_group_name="sqlcrudtest-7398", - managed_instance_name="sqlcrudtest-4645", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py new file mode 100644 index 000000000000..c2b07f780886 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python recommended_column_sensitivity_label_disable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.disable_recommendation( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py new file mode 100644 index 000000000000..d59975a15795 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python recommended_column_sensitivity_label_enable.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.enable_recommendation( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + schema_name="dbo", + table_name="myTable", + column_name="myColumn", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py deleted file mode 100644 index 0cd477140983..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python recover_deleted_server..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.deleted_servers.begin_recover( - location_name="japaneast", - deleted_server_name="sqlcrudtest-d-1414", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py new file mode 100644 index 000000000000..fb58435add85 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python recoverable_database_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.recoverable_databases.get( + resource_group_name="recoverabledatabasetest-6852", + server_name="recoverabledatabasetest-2080", + database_name="recoverabledatabasetest-9187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py new file mode 100644 index 000000000000..5185a6bd85ab --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python recoverable_database_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.recoverable_databases.list_by_server( + resource_group_name="recoverabledatabasetest-1234", + server_name="recoverabledatabasetest-7177", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py deleted file mode 100644 index 1b0e384b6d71..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python refresh_a_hub_database_schema..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.begin_refresh_hub_schema( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py deleted file mode 100644 index b331234770c4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python refresh_a_sync_member_database_schema.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.begin_refresh_member_schema( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncgroupcrud-4879", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py deleted file mode 100644 index 59366cfef4e0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python remove_a_database's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessments.delete( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py deleted file mode 100644 index 9c2d2a01b7ea..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python remove_a_managed_instance's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_vulnerability_assessments.delete( - resource_group_name="vulnerabilityaseessmenttest-4799", - managed_instance_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py deleted file mode 100644 index 54200b7f48bc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python remove_a_server's_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_vulnerability_assessments.delete( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py deleted file mode 100644 index acc7123ce646..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - parameters={ - "properties": { - "maintenanceConfigurationId": "/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py deleted file mode 100644 index 15a68f5b588a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python remove_sql_vulnerability_assessment.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sql_vulnerability_assessments.delete( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - vulnerability_assessment_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py deleted file mode 100644 index 421b548119c8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python removes_a_database's_vulnerability_assessment_rule_baseline..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_vulnerability_assessment_rule_baselines.delete( - resource_group_name="vulnerabilityaseessmenttest-4799", - server_name="vulnerabilityaseessmenttest-6440", - database_name="testdb", - vulnerability_assessment_name="default", - rule_id="VA1001", - baseline_name="default", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py new file mode 100644 index 000000000000..585af8c56f22 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python rename_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.rename( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb" + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/RenameDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py deleted file mode 100644 index 70c647f7ec71..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python renames_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.rename( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb" - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/RenameDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py deleted file mode 100644 index a67b6bbe39c8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python replace_firewall_rules.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.replace( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - parameters={ - "values": [ - { - "name": "firewallrulecrudtest-5370 ", - "properties": {"endIpAddress": "100.0.0.0", "startIpAddress": "0.0.0.0"}, - } - ] - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py new file mode 100644 index 000000000000..e1f10e6072dc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.begin_delete( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="4891ca10-ebd0-47d7-9182-c722651780fb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py new file mode 100644 index 000000000000..8d643bad349b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_failover.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.begin_failover( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="4891ca10-ebd0-47d7-9182-c722651780fb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py new file mode 100644 index 000000000000..eb50621580ae --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_failover_allow_data_loss.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.begin_failover_allow_data_loss( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="4891ca10-ebd0-47d7-9182-c722651780fb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py new file mode 100644 index 000000000000..5060806ba784 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.get( + resource_group_name="Default", + server_name="sourcesvr", + database_name="gamma-db", + link_id="4891ca10-ebd0-47d7-9182-c722651780fb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py new file mode 100644 index 000000000000..618498b71c16 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.list_by_database( + resource_group_name="Default", + server_name="sourcesvr", + database_name="tetha-db", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py new file mode 100644 index 000000000000..09882b8834fd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python replication_link_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.replication_links.list_by_server( + resource_group_name="Default", + server_name="sourcesvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py b/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py deleted file mode 100644 index be537145c7cb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python resets_maintenance_configuration_of_an_elastic_pool_to_default..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py b/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py deleted file mode 100644 index 270ba5f811d8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python resets_maintenance_window_of_a_database_to_default..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "properties": { - "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default" - }, - "sku": {"name": "BC_Gen5_4"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py new file mode 100644 index 000000000000..cfd3b915770e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_copy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_copy_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={ + "properties": { + "targetBackupStorageRedundancy": "Geo", + "targetDatabaseName": "testDatabase2", + "targetServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py new file mode 100644 index 000000000000..983e2e17ee62 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_delete_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py new file mode 100644 index 000000000000..b2457e4b29a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.get_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py new file mode 100644 index 000000000000..b3f2277cb22d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_resource_group_database( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py new file mode 100644 index 000000000000..34bb47745d2d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_resource_group_location( + resource_group_name="testResourceGroup", + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py new file mode 100644 index 000000000000..b4245488a95c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_resource_group_server( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py new file mode 100644 index 000000000000..1d299567f1ca --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_long_term_retention_backup_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.begin_update_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={"properties": {"requestedBackupStorageRedundancy": "Geo"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py new file mode 100644 index 000000000000..2eb361811a3b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_managed_instance_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py new file mode 100644 index 000000000000..1133a80ac462 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_managed_instance_long_term_retention_backup_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.get_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py new file mode 100644 index 000000000000..629de1d05396 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_managed_instance_long_term_retention_backup_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py new file mode 100644 index 000000000000..208b00843521 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_resource_group_instance( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py new file mode 100644 index 000000000000..2045aa8431d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resource_group_based_managed_instance_long_term_retention_backup_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_managed_instance_backups.list_by_resource_group_location( + resource_group_name="testResourceGroup", + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py new file mode 100644 index 000000000000..469ffe52f556 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python restorable_dropped_managed_database_list_by_managed_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.restorable_dropped_managed_databases.list_by_instance( + resource_group_name="Test1", + managed_instance_name="managedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py new file mode 100644 index 000000000000..8fb84fb0ccf9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python resume_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_resume( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdwdb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ResumeDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py deleted file mode 100644 index 7aea4f406c8e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python resumes_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_resume( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdwdb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ResumeDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py deleted file mode 100644 index 3b48890a63b8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python revalidates_the_encryption_protector.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.encryption_protectors.begin_revalidate( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - encryption_protector_name="current", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py new file mode 100644 index 000000000000..b92df352c987 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py @@ -0,0 +1,81 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sensitivity_labels_current_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.update( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + parameters={ + "operations": [ + { + "properties": { + "column": "column1", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "Financial", + "informationTypeId": "1D3652D6-422C-4115-82F1-65DAEBC665C8", + "labelId": "3A477B16-9423-432B-AA97-6069B481CEC3", + "labelName": "Highly Confidential", + "rank": "Low", + } + }, + "table": "table1", + } + }, + { + "properties": { + "column": "column2", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "PhoneNumber", + "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", + "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", + "labelName": "PII", + "rank": "Critical", + } + }, + "table": "table2", + } + }, + {"properties": {"column": "Column3", "op": "remove", "schema": "dbo", "table": "Table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py new file mode 100644 index 000000000000..2c856a12ecba --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sensitivity_labels_list_by_database_with_source_current.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.list_current_by_database( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py new file mode 100644 index 000000000000..533b083be45b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sensitivity_labels_list_by_database_with_source_recommended.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sensitivity_labels.list_recommended_by_database( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py new file mode 100644 index 000000000000..87f9c2344418 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sensitivity_labels_recommended_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.recommended_sensitivity_labels.update( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + parameters={ + "operations": [ + {"properties": {"column": "column1", "op": "enable", "schema": "dbo", "table": "table1"}}, + {"properties": {"column": "column2", "op": "enable", "schema": "dbo", "table": "table2"}}, + {"properties": {"column": "column3", "op": "disable", "schema": "dbo", "table": "table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py new file mode 100644 index 000000000000..44aa3bd1058f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advanced_threat_protection_settings_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advanced_threat_protection_settings.begin_create_or_update( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py new file mode 100644 index 000000000000..6c0235f2a980 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advanced_threat_protection_settings_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advanced_threat_protection_settings.begin_create_or_update( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + advanced_threat_protection_name="Default", + parameters={"properties": {"state": "Disabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py new file mode 100644 index 000000000000..2df5b6a5f917 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advanced_threat_protection_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advanced_threat_protection_settings.get( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + advanced_threat_protection_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py new file mode 100644 index 000000000000..045bdb532b67 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advanced_threat_protection_settings_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advanced_threat_protection_settings.list_by_server( + resource_group_name="threatprotection-4799", + server_name="threatprotection-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py new file mode 100644 index 000000000000..fb77969f4bc9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advisor_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advisors.get( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + advisor_name="CreateIndex", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py new file mode 100644 index 000000000000..af876baf5f9c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advisor_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advisors.list_by_server( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py new file mode 100644 index 000000000000..f242f587472d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_advisor_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advisors.update( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + advisor_name="CreateIndex", + parameters={"properties": {"autoExecuteStatus": "Disabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py new file mode 100644 index 000000000000..76d255fc5ea0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_auditing_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_blob_auditing_policies.list_by_server( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py new file mode 100644 index 000000000000..2d3a423ce7c8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_automatic_tuning_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.server_automatic_tuning.get( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py new file mode 100644 index 000000000000..f3ae312ad718 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_automatic_tuning_update_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.server_automatic_tuning.update( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + parameters={ + "properties": { + "desiredState": "Auto", + "options": { + "createIndex": {"desiredState": "Off"}, + "dropIndex": {"desiredState": "On"}, + "forceLastGoodPlan": {"desiredState": "Default"}, + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py new file mode 100644 index 000000000000..866ff21c70e7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_automatic_tuning_update_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + ) + + response = client.server_automatic_tuning.update( + resource_group_name="default-sql-onebox", + server_name="testsvr11", + parameters={"properties": {"desiredState": "Auto"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py new file mode 100644 index 000000000000..a5166688c9b8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py @@ -0,0 +1,58 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_blob_auditing_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_blob_auditing_policies.begin_create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + parameters={ + "properties": { + "auditActionsAndGroups": [ + "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", + "FAILED_DATABASE_AUTHENTICATION_GROUP", + "BATCH_COMPLETED_GROUP", + ], + "isAzureMonitorTargetEnabled": True, + "isStorageSecondaryKeyInUse": False, + "queueDelayMs": 4000, + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py new file mode 100644 index 000000000000..932fbb9892c6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_blob_auditing_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_blob_auditing_policies.begin_create_or_update( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + parameters={ + "properties": { + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py new file mode 100644 index 000000000000..53afba713545 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_blob_auditing_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_blob_auditing_policies.get( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py new file mode 100644 index 000000000000..49c2103c897d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_communication_link_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_communication_links.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + communication_link_name="link1", + parameters={"properties": {"partnerServer": "sqldcrudtest-test"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py new file mode 100644 index 000000000000..97cc14bf612d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_communication_link_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_communication_links.delete( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + communication_link_name="link1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py new file mode 100644 index 000000000000..6911134744c6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_communication_link_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_communication_links.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + communication_link_name="link1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py new file mode 100644 index 000000000000..81af264484b1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_communication_link_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_communication_links.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py new file mode 100644 index 000000000000..05d1d8fedada --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_connection_policies_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_connection_policies.get( + resource_group_name="rgtest-12", + server_name="servertest-6285", + connection_policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py new file mode 100644 index 000000000000..1eee82775806 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_connection_policies_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_connection_policies.list_by_server( + resource_group_name="rgtest-12", + server_name="servertest-6285", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py new file mode 100644 index 000000000000..40a94c8903c8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_connection_policies_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_connection_policies.begin_create_or_update( + resource_group_name="testrg", + server_name="testserver", + connection_policy_name="default", + parameters={"properties": {"connectionType": "Redirect"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py new file mode 100644 index 000000000000..72806f5310cd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py @@ -0,0 +1,57 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + parameters={ + "location": "Japan East", + "properties": { + "administratorLogin": "dummylogin", + "administratorLoginPassword": "PLACEHOLDER", + "administrators": { + "azureADOnlyAuthentication": True, + "login": "bob@contoso.com", + "principalType": "User", + "sid": "00000011-1111-2222-2222-123456789111", + "tenantId": "00000011-1111-2222-2222-123456789111", + }, + "publicNetworkAccess": "Enabled", + "restrictOutboundNetworkAccess": "Enabled", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py new file mode 100644 index 000000000000..55adb0acde2a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.begin_delete( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-6661", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py new file mode 100644 index 000000000000..756471367bf4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py @@ -0,0 +1,51 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dev_ops_audit_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dev_ops_audit_settings.begin_create_or_update( + resource_group_name="devAuditTestRG", + server_name="devOpsAuditTestSvr", + dev_ops_auditing_settings_name="Default", + parameters={ + "properties": { + "isAzureMonitorTargetEnabled": True, + "state": "Enabled", + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py new file mode 100644 index 000000000000..c23d4053d4ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dev_ops_audit_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dev_ops_audit_settings.begin_create_or_update( + resource_group_name="devAuditTestRG", + server_name="devOpsAuditTestSvr", + dev_ops_auditing_settings_name="Default", + parameters={ + "properties": { + "state": "Enabled", + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py new file mode 100644 index 000000000000..2530b8f26a08 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dev_ops_audit_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dev_ops_audit_settings.get( + resource_group_name="devAuditTestRG", + server_name="devOpsAuditTestSvr", + dev_ops_auditing_settings_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py new file mode 100644 index 000000000000..f69d056281df --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dev_ops_audit_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dev_ops_audit_settings.list_by_server( + resource_group_name="devAuditTestRG", + server_name="devOpsAuditTestSvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py new file mode 100644 index 000000000000..b9250a6a3fbd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dns_alias_acquire.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dns_aliases.begin_acquire( + resource_group_name="Default", + server_name="dns-alias-new-server", + dns_alias_name="dns-alias-name-1", + parameters={ + "oldServerDnsAliasId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-old-server/dnsAliases/dns-alias-name-1" + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py new file mode 100644 index 000000000000..da0092256d68 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dns_alias_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dns_aliases.begin_create_or_update( + resource_group_name="Default", + server_name="dns-alias-server", + dns_alias_name="dns-alias-name-1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py new file mode 100644 index 000000000000..80a6c94a1304 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dns_aliases.begin_delete( + resource_group_name="Default", + server_name="dns-alias-server", + dns_alias_name="dns-alias-name-1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py new file mode 100644 index 000000000000..e395046e5115 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dns_aliases.get( + resource_group_name="Default", + server_name="dns-alias-server", + dns_alias_name="dns-alias-name-1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py new file mode 100644 index 000000000000..ea3eb7e9d274 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_dns_alias_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_dns_aliases.list_by_server( + resource_group_name="Default", + server_name="dns-alias-server", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py new file mode 100644 index 000000000000..fe888366408e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_extended_auditing_settings_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.extended_server_blob_auditing_policies.list_by_server( + resource_group_name="blobauditingtest-4799", + server_name="blobauditingtest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py new file mode 100644 index 000000000000..1f11d02516fb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py new file mode 100644 index 000000000000..d77c905e12be --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_get_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py new file mode 100644 index 000000000000..f37e45cf854f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_key_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_keys.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + parameters={ + "properties": { + "serverKeyType": "AzureKeyVault", + "uri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py new file mode 100644 index 000000000000..977824130c2f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_key_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_keys.begin_delete( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py new file mode 100644 index 000000000000..bfb6ce03fdc5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_keys.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + key_name="someVault_someKey_01234567890123456789012345678901", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py new file mode 100644 index 000000000000..4f51e7df04a1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_key_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_keys.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py new file mode 100644 index 000000000000..c5bf00eff6f1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py new file mode 100644 index 000000000000..ed00c6144493 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_list_by_resource_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.list_by_resource_group( + resource_group_name="sqlcrudtest-7398", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py new file mode 100644 index 000000000000..de3ca30d5975 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_list_by_resource_group_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.list_by_resource_group( + resource_group_name="sqlcrudtest-7398", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py new file mode 100644 index 000000000000..44393f0ac9b6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_list_with_expand_equals_administrators.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListWithExpandEqualsAdministrators.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py new file mode 100644 index 000000000000..7cfb2c308871 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_recommended_action_list_expand.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_advisors.list_by_server( + resource_group_name="workloadinsight-demos", + server_name="misosisvr", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py new file mode 100644 index 000000000000..7685267bfe4e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_security_alerts_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_security_alert_policies.begin_create_or_update( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + security_alert_policy_name="Default", + parameters={ + "properties": { + "disabledAlerts": ["Access_Anomaly", "Usage_Anomaly"], + "emailAccountAdmins": True, + "emailAddresses": ["testSecurityAlert@microsoft.com"], + "retentionDays": 5, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py new file mode 100644 index 000000000000..58fafd057c0e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_security_alerts_create_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_security_alert_policies.begin_create_or_update( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + security_alert_policy_name="Default", + parameters={"properties": {"state": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py new file mode 100644 index 000000000000..58ab4b119436 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_security_alerts_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_security_alert_policies.get( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + security_alert_policy_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py new file mode 100644 index 000000000000..99413f1f6b99 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_security_alerts_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_security_alert_policies.list_by_server( + resource_group_name="securityalert-4799", + server_name="securityalert-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py new file mode 100644 index 000000000000..20581b93b267 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_certificates_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="0574222d-5c7f-489c-a172-b3013eafab53", + ) + + response = client.server_trust_certificates.begin_create_or_update( + resource_group_name="testrg", + managed_instance_name="testcl", + certificate_name="customerCertificateName", + parameters={"properties": {"publicBlob": "308203AE30820296A0030201020210"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py new file mode 100644 index 000000000000..d059cbfd7b90 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_certificates_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + ) + + response = client.server_trust_certificates.begin_delete( + resource_group_name="testrg", + managed_instance_name="testcl", + certificate_name="customerCertificateName", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py new file mode 100644 index 000000000000..99d273a476c7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_certificates_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + ) + + response = client.server_trust_certificates.get( + resource_group_name="testrg", + managed_instance_name="testcl", + certificate_name="customerCertificateName", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py new file mode 100644 index 000000000000..26d98f824abe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_certificates_list_by_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + ) + + response = client.server_trust_certificates.list_by_instance( + resource_group_name="testrg", + managed_instance_name="testcl", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py new file mode 100644 index 000000000000..2b4d44dffbab --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_group_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_trust_groups.begin_create_or_update( + resource_group_name="Default", + location_name="Japan East", + server_trust_group_name="server-trust-group-test", + parameters={ + "properties": { + "groupMembers": [ + { + "serverId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1" + }, + { + "serverId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2" + }, + ], + "trustScopes": ["GlobalTransactions", "ServiceBroker"], + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py new file mode 100644 index 000000000000..b2eb24b0d89f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_trust_groups.begin_delete( + resource_group_name="Default", + location_name="Japan East", + server_trust_group_name="server-trust-group-test", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py new file mode 100644 index 000000000000..5cdb873900c3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_trust_groups.get( + resource_group_name="Default", + location_name="Japan East", + server_trust_group_name="server-trust-group-test", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py new file mode 100644 index 000000000000..2da1842e8ea3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_trust_groups.list_by_location( + resource_group_name="Default", + location_name="Japan East", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py new file mode 100644 index 000000000000..59c0d1e910b0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_trust_group_list_by_managed_instance.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_trust_groups.list_by_instance( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="managedInstance-1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py new file mode 100644 index 000000000000..a14317738c89 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py @@ -0,0 +1,49 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.servers.begin_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + parameters={ + "properties": { + "administratorLogin": "dummylogin", + "administratorLoginPassword": "placeholder", + "publicNetworkAccess": "Disabled", + "restrictOutboundNetworkAccess": "Enabled", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py new file mode 100644 index 000000000000..196ac93b31f0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_usage_metrics_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_usages.list_by_server( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py new file mode 100644 index 000000000000..86fbbc6d85ce --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_create_container_sas_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py new file mode 100644 index 000000000000..5671d8bc63a0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py @@ -0,0 +1,54 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_create_max.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "recurringScans": { + "emailSubscriptionAdmins": True, + "emails": ["email1@mail.com", "email2@mail.com"], + "isEnabled": True, + }, + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py new file mode 100644 index 000000000000..afdf46ef8b8d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_create_storage_access_key_min.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py new file mode 100644 index 000000000000..4d87229ce241 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py new file mode 100644 index 000000000000..7eaf89a6a8a3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py new file mode 100644 index 000000000000..0b721642c197 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python server_vulnerability_assessment_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_vulnerability_assessments.list_by_server( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py new file mode 100644 index 000000000000..73e1c51aa36e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python service_objective_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.service_objectives.get( + resource_group_name="group1", + server_name="sqlcrudtest", + service_objective_name="29dd7459-4a7c-4e56-be22-f0adda49440d", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py new file mode 100644 index 000000000000..17758295e5eb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python service_objective_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.service_objectives.list_by_server( + resource_group_name="group1", + server_name="sqlcrudtest", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py deleted file mode 100644 index 3cee89a055e3..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python sets_maintenance_window_settings_for_a_selected_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.maintenance_windows.create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdwdb", - maintenance_window_name="current", - parameters={ - "properties": {"timeRanges": [{"dayOfWeek": "Saturday", "duration": "PT60M", "startTime": "00:00:00"}]} - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py new file mode 100644 index 000000000000..3c2da6291c3f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_agent_configuration_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_agent.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py new file mode 100644 index 000000000000..9680488f5c3d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_agent_configuration_put.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_agent.create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py new file mode 100644 index 000000000000..84bb76a24f7d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_tde_certificate_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000001", + ) + + response = client.tde_certificates.begin_create( + resource_group_name="testtdecert", + server_name="testtdecert", + parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py new file mode 100644 index 000000000000..4e12146256ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py @@ -0,0 +1,52 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_baseline_add.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={ + "properties": { + "latestScan": False, + "results": { + "VA2063": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + "VA2065": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineAdd.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py new file mode 100644 index 000000000000..121d0d9b0910 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_baseline_add_latest.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={"properties": {"latestScan": True, "results": {}}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py new file mode 100644 index 000000000000..0a6daeed89bc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_baseline.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py new file mode 100644 index 000000000000..86b8fd3b0354 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py new file mode 100644 index 000000000000..d92aae9d3057 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessments_settings.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py new file mode 100644 index 000000000000..50c8d5808f55 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py new file mode 100644 index 000000000000..0cd52a7cf2ea --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessments_settings.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py new file mode 100644 index 000000000000..983fffd74868 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessments_settings.list_by_server( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py new file mode 100644 index 000000000000..dfaab96dedd3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_list_scans_results.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_scan_result.list_by_scan( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="testsvr", + vulnerability_assessment_name="default", + scan_id="scanId1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py new file mode 100644 index 000000000000..c6963c7a22ac --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,50 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_rule_baseline_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_rule_baseline.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + parameters={ + "properties": { + "latestScan": False, + "results": [["userA", "SELECT"], ["userB", "SELECT"], ["userC", "SELECT"]], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py new file mode 100644 index 000000000000..d6ff3d83d2f8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py new file mode 100644 index 000000000000..9dbf4a7dec6f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_rule_baseline_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_rule_baseline.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py new file mode 100644 index 000000000000..558be462ae90 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_rule_baseline_list_by_baseline.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py new file mode 100644 index 000000000000..3bd9a1fb0e3d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_scan.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_scans.get( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScan.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py new file mode 100644 index 000000000000..0bd2dded3e32 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_scan_records_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py new file mode 100644 index 000000000000..497f26ca0dbf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_scans_execute.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_execute_scan.begin_execute( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py new file mode 100644 index 000000000000..a5018b9028ad --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sql_vulnerability_assessment_scans_results.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sql_vulnerability_assessment_scan_result.get( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + scan_id="scanId1", + scan_result_id="VA1234", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py deleted file mode 100644 index 021b0726c701..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python start_a_job_execution..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_executions.begin_create( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - job_name="job1", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py deleted file mode 100644 index 543409ece8c2..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python starts_a_managed_database_move_with_all_optional_parameters_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_start_move( - resource_group_name="group1", - managed_instance_name="testInstanceSrc", - database_name="testDatabase", - parameters={ - "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase", - "operationMode": "Copy", - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseStartMoveMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py deleted file mode 100644 index 198a254b3a3a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python starts_a_managed_database_move_with_no_optional_parameters_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_start_move( - resource_group_name="group1", - managed_instance_name="testInstanceSrc", - database_name="testDatabase", - parameters={ - "destinationManagedDatabaseId": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseStartMoveMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py new file mode 100644 index 000000000000..5e43181a2d3c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python subscription_usage_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.subscription_usages.get( + location_name="WestUS", + usage_name="ServerQuota", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py new file mode 100644 index 000000000000..3b1486f80e5b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python subscription_usage_list_by_location.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.subscription_usages.list_by_location( + location_name="WestUS", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py new file mode 100644 index 000000000000..ebd926c67fea --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python synapse_link_workspace_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.synapse_link_workspaces.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="dbSynapse", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/SynapseLinkWorkspaceListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py new file mode 100644 index 000000000000..c692cb3514cc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.begin_create_or_update( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + parameters={ + "properties": { + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync" + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py new file mode 100644 index 000000000000..b6560bb782e8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.begin_delete( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py new file mode 100644 index 000000000000..61cb966f8145 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_generate_key.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.generate_key( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py new file mode 100644 index 000000000000..5bd6bd1d6235 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.get( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py new file mode 100644 index 000000000000..ba594c4ba858 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_get_linked_databases.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.list_linked_databases( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py new file mode 100644 index 000000000000..be7e747242d2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_list_by_server.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.list_by_server( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py new file mode 100644 index 000000000000..e03de9ff045b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_agent_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_agents.begin_create_or_update( + resource_group_name="syncagentcrud-65440", + server_name="syncagentcrud-8475", + sync_agent_name="syncagentcrud-3187", + parameters={ + "properties": { + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync" + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py new file mode 100644 index 000000000000..44dd66dbd5b4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_cancel_sync.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.cancel_sync( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py new file mode 100644 index 000000000000..ccd18c4c80da --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py @@ -0,0 +1,52 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "properties": { + "conflictResolutionPolicy": "HubWin", + "hubDatabaseUserName": "hubUser", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py new file mode 100644 index 000000000000..233e9e7f5ff7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.begin_delete( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py new file mode 100644 index 000000000000..4c59d42489cf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.get( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py new file mode 100644 index 000000000000..27e0f17ab4d6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_get_hub_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.list_hub_schemas( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py new file mode 100644 index 000000000000..c0b606ab4719 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_get_log.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.list_logs( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + start_time="2017-01-01T00:00:00", + end_time="2017-12-31T00:00:00", + type="All", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py new file mode 100644 index 000000000000..b85cbcad4cb9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_get_sync_database_id.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.list_sync_database_ids( + location_name="westus", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py new file mode 100644 index 000000000000..4731abac2c5a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_list_by_database.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.list_by_database( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py new file mode 100644 index 000000000000..a13611ffcb3b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py @@ -0,0 +1,53 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "properties": { + "conflictResolutionPolicy": "HubWin", + "hubDatabasePassword": "hubPassword", + "hubDatabaseUserName": "hubUser", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py new file mode 100644 index 000000000000..dab504e2f495 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_refresh_hub_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.begin_refresh_hub_schema( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py new file mode 100644 index 000000000000..820f76ceb692 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_trigger_sync.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.trigger_sync( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py new file mode 100644 index 000000000000..b13ac1f83501 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py @@ -0,0 +1,52 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_groups.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "properties": { + "conflictResolutionPolicy": "HubWin", + "hubDatabaseUserName": "hubUser", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py new file mode 100644 index 000000000000..b3c6fba195e1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + "userName": "myUser", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py new file mode 100644 index 000000000000..e1ffaed7d98e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.begin_delete( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncgroupcrud-4879", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py new file mode 100644 index 000000000000..b7784d90af09 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.get( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py new file mode 100644 index 000000000000..2d46c3ac9038 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_get_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.list_member_schemas( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncgroupcrud-4879", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py new file mode 100644 index 000000000000..4bce23f44ced --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_list_by_sync_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.list_by_sync_group( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py new file mode 100644 index 000000000000..1b05d3be040f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + "userName": "myUser", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py new file mode 100644 index 000000000000..783965eb2ec8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_refresh_schema.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.begin_refresh_member_schema( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncgroupcrud-4879", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py new file mode 100644 index 000000000000..b287819ac62e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py @@ -0,0 +1,55 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.sync_members.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + "userName": "myUser", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py new file mode 100644 index 000000000000..e20bf2611fc8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python transparent_data_encryption_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.transparent_data_encryptions.get( + resource_group_name="security-tde-resourcegroup", + server_name="securitytde", + database_name="testdb", + tde_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py new file mode 100644 index 000000000000..afa18a94a318 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python transparent_data_encryption_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.transparent_data_encryptions.list_by_database( + resource_group_name="security-tde-resourcegroup", + server_name="securitytde", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py new file mode 100644 index 000000000000..33e08c6b71db --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python transparent_data_encryption_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.transparent_data_encryptions.create_or_update( + resource_group_name="securitytde-42-rg", + server_name="securitytde-42", + database_name="testdb", + tde_name="current", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py b/sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py deleted file mode 100644 index 54a5e40c10b0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python trigger_a_sync_group_synchronization..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.trigger_sync( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py deleted file mode 100644 index d82b669f8098..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_database's_advanced_threat_protection_settings_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advanced_threat_protection_settings.create_or_update( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - database_name="testdb", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py deleted file mode 100644 index bc5c9537c6b9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advanced_threat_protection_settings.create_or_update( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - database_name="testdb", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Disabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py deleted file mode 100644 index 4828bdfc7fab..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_database's_threat_detection_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_security_alert_policies.create_or_update( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - database_name="testdb", - security_alert_policy_name="Default", - parameters={ - "properties": { - "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], - "emailAccountAdmins": True, - "emailAddresses": ["test@microsoft.com", "user@microsoft.com"], - "retentionDays": 6, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py deleted file mode 100644 index 38653fcbf1a4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_database's_threat_detection_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_security_alert_policies.create_or_update( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - database_name="testdb", - security_alert_policy_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py deleted file mode 100644 index 68c3859a8191..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_database's_transparent_data_encryption_state_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_transparent_data_encryption.create_or_update( - resource_group_name="securitytde-42-rg", - managed_instance_name="securitytde-42", - database_name="testdb", - tde_name="current", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py deleted file mode 100644 index 4082173bb5c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_firewall_rule_max/min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.firewall_rules.create_or_update( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-3927", - parameters={"properties": {"endIpAddress": "0.0.0.1", "startIpAddress": "0.0.0.1"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py deleted file mode 100644 index 0bb530f1317c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_job_agent's_tags..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.job_agents.begin_update( - resource_group_name="group1", - server_name="server1", - job_agent_name="agent1", - parameters={"tags": {"mytag1": "myvalue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py deleted file mode 100644 index fbb39a863a63..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_advanced_threat_protection_settings.create_or_update( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - database_name="testdb", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py deleted file mode 100644 index 008fe2ee8eaa..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_advanced_threat_protection_settings.create_or_update( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - database_name="testdb", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Disabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py deleted file mode 100644 index 1d31155cdbc5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py deleted file mode 100644 index 289fbcfd12c4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( - resource_group_name="threatprotection-4799", - managed_instance_name="threatprotection-6440", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Disabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py deleted file mode 100644 index fcf961ea5268..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_server's_threat_detection_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_security_alert_policies.begin_create_or_update( - resource_group_name="securityalert-4799", - managed_instance_name="securityalert-6440", - security_alert_policy_name="Default", - parameters={ - "properties": { - "disabledAlerts": ["Access_Anomaly", "Usage_Anomaly"], - "emailAccountAdmins": True, - "emailAddresses": ["testSecurityAlert@microsoft.com"], - "retentionDays": 5, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py deleted file mode 100644 index 0c4fd651770e..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_managed_server's_threat_detection_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_server_security_alert_policies.begin_create_or_update( - resource_group_name="securityalert-4799", - managed_instance_name="securityalert-6440", - security_alert_policy_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py deleted file mode 100644 index 093fdc495877..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_advanced_threat_protection_settings_with_all_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advanced_threat_protection_settings.begin_create_or_update( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py deleted file mode 100644 index 66a462e140e8..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advanced_threat_protection_settings.begin_create_or_update( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - advanced_threat_protection_name="Default", - parameters={"properties": {"state": "Disabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py deleted file mode 100644 index 4964a98d5e1c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_blob_auditing_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_blob_auditing_policies.begin_create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - parameters={ - "properties": { - "auditActionsAndGroups": [ - "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", - "FAILED_DATABASE_AUTHENTICATION_GROUP", - "BATCH_COMPLETED_GROUP", - ], - "isAzureMonitorTargetEnabled": True, - "isStorageSecondaryKeyInUse": False, - "queueDelayMs": 4000, - "retentionDays": 6, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index d4b98cda40a1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_blob_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_blob_auditing_policies.begin_create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - parameters={ - "properties": { - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py deleted file mode 100644 index d7238784fd7a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_dev_ops_audit_settings_with_all_params.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dev_ops_audit_settings.begin_create_or_update( - resource_group_name="devAuditTestRG", - server_name="devOpsAuditTestSvr", - dev_ops_auditing_settings_name="Default", - parameters={ - "properties": { - "isAzureMonitorTargetEnabled": True, - "state": "Enabled", - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py deleted file mode 100644 index cec15fcfaf58..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_dev_ops_audit_settings_with_minimal_input.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_dev_ops_audit_settings.begin_create_or_update( - resource_group_name="devAuditTestRG", - server_name="devOpsAuditTestSvr", - dev_ops_auditing_settings_name="Default", - parameters={ - "properties": { - "state": "Enabled", - "storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py deleted file mode 100644 index dd0d952a5d1a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_extended_blob_auditing_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_server_blob_auditing_policies.begin_create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - parameters={ - "properties": { - "auditActionsAndGroups": [ - "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", - "FAILED_DATABASE_AUTHENTICATION_GROUP", - "BATCH_COMPLETED_GROUP", - ], - "isAzureMonitorTargetEnabled": True, - "isStorageSecondaryKeyInUse": False, - "predicateExpression": "object_name = 'SensitiveData'", - "queueDelayMs": 4000, - "retentionDays": 6, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py deleted file mode 100644 index 58ca2ddbaeeb..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.extended_server_blob_auditing_policies.begin_create_or_update( - resource_group_name="blobauditingtest-4799", - server_name="blobauditingtest-6440", - parameters={ - "properties": { - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py deleted file mode 100644 index 9445c18faca0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_threat_detection_policy_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_security_alert_policies.begin_create_or_update( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - security_alert_policy_name="Default", - parameters={ - "properties": { - "disabledAlerts": ["Access_Anomaly", "Usage_Anomaly"], - "emailAccountAdmins": True, - "emailAddresses": ["testSecurityAlert@microsoft.com"], - "retentionDays": 5, - "state": "Enabled", - "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", - "storageEndpoint": "https://mystorage.blob.core.windows.net", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py deleted file mode 100644 index 2f9da9a71b14..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server's_threat_detection_policy_with_minimal_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_security_alert_policies.begin_create_or_update( - resource_group_name="securityalert-4799", - server_name="securityalert-6440", - security_alert_policy_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py deleted file mode 100644 index 8479de83c59b..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_server.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.servers.begin_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - parameters={ - "properties": { - "administratorLogin": "dummylogin", - "administratorLoginPassword": "placeholder", - "publicNetworkAccess": "Disabled", - "restrictOutboundNetworkAccess": "Enabled", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py deleted file mode 100644 index 81cbe1557d0c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_sync_agent.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_agents.begin_create_or_update( - resource_group_name="syncagentcrud-65440", - server_name="syncagentcrud-8475", - sync_agent_name="syncagentcrud-3187", - parameters={ - "properties": { - "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync" - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py deleted file mode 100644 index 0f97672d8ab4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_sync_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_groups.begin_create_or_update( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - parameters={ - "properties": { - "conflictResolutionPolicy": "HubWin", - "hubDatabaseUserName": "hubUser", - "interval": -1, - "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", - "usePrivateLinkConnection": True, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py deleted file mode 100644 index 7ba5e2d5f051..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_a_sync_member.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.begin_create_or_update( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncmembercrud-4879", - parameters={ - "properties": { - "databaseName": "syncgroupcrud-7421", - "databaseType": "AzureSqlDatabase", - "serverName": "syncgroupcrud-3379.database.windows.net", - "syncDirection": "Bidirectional", - "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", - "usePrivateLinkConnection": True, - "userName": "myUser", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py deleted file mode 100644 index 5df18e8f5eda..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_administrator_of_managed_instance.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_administrators.begin_create_or_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - administrator_name="ActiveDirectory", - parameters={ - "properties": { - "administratorType": "ActiveDirectory", - "login": "bob@contoso.com", - "sid": "44444444-3333-2222-1111-000000000000", - "tenantId": "55555555-4444-3333-2222-111111111111", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py deleted file mode 100644 index 8bd7585e13ca..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_an_elastic_pool_with_all_parameter.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={ - "properties": { - "licenseType": "LicenseIncluded", - "perDatabaseSettings": {"maxCapacity": 1, "minCapacity": 0.25}, - "zoneRedundant": True, - }, - "sku": {"capacity": 2, "name": "BC_Gen4", "tier": "BusinessCritical"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py deleted file mode 100644 index a0a6565405e5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_an_existing_sync_member.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sync_members.begin_update( - resource_group_name="syncgroupcrud-65440", - server_name="syncgroupcrud-8475", - database_name="syncgroupcrud-4328", - sync_group_name="syncgroupcrud-3187", - sync_member_name="syncmembercrud-4879", - parameters={ - "properties": { - "databaseName": "syncgroupcrud-7421", - "databaseType": "AzureSqlDatabase", - "serverName": "syncgroupcrud-3379.database.windows.net", - "syncDirection": "Bidirectional", - "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", - "usePrivateLinkConnection": True, - "userName": "myUser", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py deleted file mode 100644 index d48e08e42225..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_an_ipv6_firewall_rule_max/min.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.ipv6_firewall_rules.create_or_update( - resource_group_name="firewallrulecrudtest-12", - server_name="firewallrulecrudtest-6285", - firewall_rule_name="firewallrulecrudtest-3927", - parameters={ - "properties": { - "endIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0001", - "startIPv6Address": "0000:0000:0000:0000:0000:ffff:0000:0001", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py deleted file mode 100644 index 861372080d3d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_database_advisor.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_advisors.update( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - advisor_name="CreateIndex", - parameters={"properties": {"autoExecuteStatus": "Disabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py deleted file mode 100644 index 11f182963b73..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_database_recommended_action.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.database_recommended_actions.update( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - database_name="IndexAdvisor_test_3", - advisor_name="CreateIndex", - recommended_action_name="IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - parameters={"properties": {"state": {"currentValue": "Pending"}}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py deleted file mode 100644 index ef6145354a9a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_failover_group.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.failover_groups.begin_update( - resource_group_name="Default", - server_name="failover-group-primary-server", - failover_group_name="failover-group-test-1", - parameters={ - "properties": { - "databases": [ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1" - ], - "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 120}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py deleted file mode 100644 index ec6feb21027c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_geo_backup_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.geo_backup_policies.create_or_update( - resource_group_name="sqlcrudtest-4799", - server_name="sqlcrudtest-5961", - database_name="testdw", - geo_backup_policy_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py deleted file mode 100644 index b39934d80013..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_high_availability_replica_count_of_a_hyperscale_elastic_pool..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.begin_update( - resource_group_name="sqlcrudtest-2369", - server_name="sqlcrudtest-8069", - elastic_pool_name="sqlcrudtest-8102", - parameters={"properties": {"highAvailabilityReplicaCount": 2}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py new file mode 100644 index 000000000000..6367b898c94b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python update_job_agent.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.job_agents.begin_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + parameters={"tags": {"mytag1": "myvalue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py deleted file mode 100644 index b52d449ecdc0..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_managed_instance_with_all_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - parameters={ - "properties": { - "administratorLogin": "dummylogin", - "administratorLoginPassword": "PLACEHOLDER", - "collation": "SQL_Latin1_General_CP1_CI_AS", - "licenseType": "BasePrice", - "maintenanceConfigurationId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1", - "minimalTlsVersion": "1.2", - "proxyOverride": "Redirect", - "publicDataEndpointEnabled": False, - "requestedBackupStorageRedundancy": "Geo", - "storageSizeInGB": 448, - "vCores": 8, - }, - "sku": {"capacity": 8, "name": "GP_Gen4", "tier": "GeneralPurpose"}, - "tags": {"tagKey1": "TagValue1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py deleted file mode 100644 index 401ff41d7a97..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_managed_instance_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", - ) - - response = client.managed_instances.begin_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - parameters={"tags": {"tagKey1": "TagValue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py new file mode 100644 index 000000000000..83df76344806 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python update_managed_short_term_retention_policy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + managed_instance_name="testsvr", + database_name="testdb", + policy_name="default", + parameters={"properties": {"retentionDays": 14}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py new file mode 100644 index 000000000000..4cbae2fcb5a3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python update_managed_short_term_retention_policy_restorable_dropped.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + policy_name="default", + parameters={"properties": {"retentionDays": 14}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py deleted file mode 100644 index 69ab50b6004a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_recommended_sensitivity_labels.update( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - parameters={ - "operations": [ - {"properties": {"column": "column1", "op": "enable", "schema": "dbo", "table": "table1"}}, - {"properties": {"column": "column2", "op": "disable", "schema": "dbo", "table": "table2"}}, - {"properties": {"column": "Column3", "op": "disable", "schema": "dbo", "table": "Table1"}}, - ] - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py deleted file mode 100644 index 2c5ef71dd8da..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py +++ /dev/null @@ -1,79 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_sensitivity_labels_of_a_given_database_using_an_operations_batch..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.update( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - parameters={ - "operations": [ - { - "properties": { - "column": "column1", - "op": "set", - "schema": "dbo", - "sensitivityLabel": { - "properties": { - "informationType": "Financial", - "informationTypeId": "1D3652D6-422C-4115-82F1-65DAEBC665C8", - "labelId": "3A477B16-9423-432B-AA97-6069B481CEC3", - "labelName": "Highly Confidential", - } - }, - "table": "table1", - } - }, - { - "properties": { - "column": "column2", - "op": "set", - "schema": "dbo", - "sensitivityLabel": { - "properties": { - "informationType": "PhoneNumber", - "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", - "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", - "labelName": "PII", - } - }, - "table": "table2", - } - }, - {"properties": {"column": "Column3", "op": "remove", "schema": "dbo", "table": "Table1"}}, - ] - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py deleted file mode 100644 index 6085e984c782..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_server_advisor.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_advisors.update( - resource_group_name="workloadinsight-demos", - server_name="misosisvr", - advisor_name="CreateIndex", - parameters={"properties": {"autoExecuteStatus": "Disabled"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py new file mode 100644 index 000000000000..663ec3b45548 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python update_short_term_retention_policy.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + server_name="testsvr", + database_name="testdb", + policy_name="default", + parameters={"properties": {"diffBackupIntervalInHours": 24, "retentionDays": 7}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py deleted file mode 100644 index 49476ac4edfc..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_distributed_availability_group_replication_mode_before_deleting_it..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.distributed_availability_groups.begin_update( - resource_group_name="testrg", - managed_instance_name="testcl", - distributed_availability_group_name="dag", - parameters={"properties": {"replicationMode": "Sync"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py deleted file mode 100644 index 74c85e1453a9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_encryption_protector_to_key_vault.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.encryption_protectors.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - encryption_protector_name="current", - parameters={ - "properties": { - "autoRotationEnabled": False, - "serverKeyName": "someVault_someKey_01234567890123456789012345678901", - "serverKeyType": "AzureKeyVault", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py deleted file mode 100644 index b3e96cc06016..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_encryption_protector_to_service_managed.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.encryption_protectors.begin_create_or_update( - resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - encryption_protector_name="current", - parameters={"properties": {"serverKeyName": "ServiceManaged", "serverKeyType": "ServiceManaged"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py deleted file mode 100644 index 1071aaba51d4..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_long_term_retention_backup..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.long_term_retention_backups.begin_update( - location_name="japaneast", - long_term_retention_server_name="testserver", - long_term_retention_database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", - parameters={"properties": {"requestedBackupStorageRedundancy": "Geo"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py deleted file mode 100644 index 7f1bd9468973..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_short_term_retention_policy_for_the_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_backup_short_term_retention_policies.begin_create_or_update( - resource_group_name="resourceGroup", - managed_instance_name="testsvr", - database_name="testdb", - policy_name="default", - parameters={"properties": {"retentionDays": 14}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py deleted file mode 100644 index dc5db1d7523a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py +++ /dev/null @@ -1,44 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_the_short_term_retention_policy_for_the_restorable_dropped_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.begin_create_or_update( - resource_group_name="resourceGroup", - managed_instance_name="testsvr", - restorable_dropped_database_id="testdb,131403269876900000", - policy_name="default", - parameters={"properties": {"retentionDays": 14}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py new file mode 100644 index 000000000000..79c544683464 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python update_virtual_cluster_dns_servers.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.virtual_clusters.begin_update_dns_servers( + resource_group_name="sqlcrudtest-7398", + virtual_cluster_name="VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpdateVirtualClusterDnsServers.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py deleted file mode 100644 index 9dc34b5c7734..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python update_virtual_cluster_with_tags.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", - ) - - response = client.virtual_clusters.begin_update( - resource_group_name="testrg", - virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - parameters={"tags": {"tkey": "tvalue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py deleted file mode 100644 index cfc545ba51f9..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_a_database..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_update( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdb", - parameters={ - "properties": {"licenseType": "LicenseIncluded", "maxSizeBytes": 1073741824}, - "sku": {"name": "BC_Gen4_4"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabase.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py deleted file mode 100644 index af6df3c3d8c1..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_a_managed_database_with_maximal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="testdb", - parameters={"tags": {"tagKey1": "TagValue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py deleted file mode 100644 index 79e0fac83d46..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_a_managed_database_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_databases.begin_update( - resource_group_name="Default-SQL-SouthEastAsia", - managed_instance_name="managedInstance", - database_name="testdb", - parameters={"tags": {"tagKey1": "TagValue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py deleted file mode 100644 index 87b389281b97..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_a_server_connection_policy.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_connection_policies.begin_create_or_update( - resource_group_name="testrg", - server_name="testserver", - connection_policy_name="default", - parameters={"properties": {"connectionType": "Redirect"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py deleted file mode 100644 index 936b93d4ef41..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_database_automatic_tuning_settings_with_all_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.database_automatic_tuning.update( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - database_name="db1", - parameters={ - "properties": { - "desiredState": "Auto", - "options": { - "createIndex": {"desiredState": "Off"}, - "dropIndex": {"desiredState": "On"}, - "forceLastGoodPlan": {"desiredState": "Default"}, - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py deleted file mode 100644 index 558fd6cc93bf..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_database_automatic_tuning_settings_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.database_automatic_tuning.update( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - database_name="db1", - parameters={"properties": {"desiredState": "Auto"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py deleted file mode 100644 index e0a2e76b9190..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py +++ /dev/null @@ -1,43 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_managed_instance_dtc_settings_by_enabling_dtc..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_dtcs.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - dtc_name="current", - parameters={"properties": {"dtcEnabled": True}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateEnableDtc.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py deleted file mode 100644 index 117f6370a171..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py +++ /dev/null @@ -1,59 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_instance_dtcs.begin_create_or_update( - resource_group_name="testrg", - managed_instance_name="testinstance", - dtc_name="current", - parameters={ - "properties": { - "dtcEnabled": True, - "externalDnsSuffixSearchList": ["dns.example1.com", "dns.example2.com"], - "securitySettings": { - "snaLu6point2TransactionsEnabled": False, - "transactionManagerCommunicationSettings": { - "allowInboundEnabled": False, - "allowOutboundEnabled": True, - "authentication": "NoAuth", - }, - "xaTransactionsDefaultTimeout": 1000, - "xaTransactionsEnabled": False, - "xaTransactionsMaximumTimeout": 3000, - }, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py deleted file mode 100644 index 8b48d0266209..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.managed_database_sensitivity_labels.create_or_update( - resource_group_name="myRG", - managed_instance_name="myManagedInstanceName", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - parameters={ - "properties": { - "informationType": "PhoneNumber", - "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", - "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", - "labelName": "PII", - "rank": "High", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py deleted file mode 100644 index 0387425cf8b5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_server_automatic_tuning_settings_with_all_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.server_automatic_tuning.update( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - parameters={ - "properties": { - "desiredState": "Auto", - "options": { - "createIndex": {"desiredState": "Off"}, - "dropIndex": {"desiredState": "On"}, - "forceLastGoodPlan": {"desiredState": "Default"}, - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py deleted file mode 100644 index 6bcc30180e07..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_server_automatic_tuning_settings_with_minimal_properties.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", - ) - - response = client.server_automatic_tuning.update( - resource_group_name="default-sql-onebox", - server_name="testsvr11", - parameters={"properties": {"desiredState": "Auto"}}, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py deleted file mode 100644 index 56df132a0828..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python updates_the_sensitivity_label_of_a_given_column_with_all_parameters.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.sensitivity_labels.create_or_update( - resource_group_name="myRG", - server_name="myServer", - database_name="myDatabase", - schema_name="dbo", - table_name="myTable", - column_name="myColumn", - parameters={ - "properties": { - "informationType": "PhoneNumber", - "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", - "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", - "labelName": "PII", - "rank": "Low", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py new file mode 100644 index 000000000000..f5e9033c5a07 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python upgrade_data_warehouse.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.begin_upgrade_data_warehouse( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdwdb", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpgradeDataWarehouse.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py deleted file mode 100644 index 46a9d0358b12..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python upgrades_a_data_warehouse..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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.begin_upgrade_data_warehouse( - resource_group_name="Default-SQL-SouthEastAsia", - server_name="testsvr", - database_name="testdwdb", - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/UpgradeDataWarehouse.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py deleted file mode 100644 index 3cb4a052ee73..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.sql import SqlManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-sql -# USAGE - python upload_a_tde_certificate.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 = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000001", - ) - - response = client.managed_instance_tde_certificates.begin_create( - resource_group_name="testtdecert", - managed_instance_name="testtdecert", - parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py new file mode 100644 index 000000000000..2d3d33c79358 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_cluster_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.virtual_clusters.begin_delete( + resource_group_name="testrg", + virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py new file mode 100644 index 000000000000..d5c54b066706 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_cluster_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.virtual_clusters.get( + resource_group_name="testrg", + virtual_cluster_name="vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py new file mode 100644 index 000000000000..c24b09cbcbbd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py @@ -0,0 +1,39 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_cluster_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.virtual_clusters.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py new file mode 100644 index 000000000000..cce68103817f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py @@ -0,0 +1,41 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_cluster_list_by_resource_group.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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.virtual_clusters.list_by_resource_group( + resource_group_name="testrg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py new file mode 100644 index 000000000000..f5074ed941b6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_cluster_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + ) + + response = client.virtual_clusters.begin_update( + resource_group_name="testrg", + virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", + parameters={"tags": {"tkey": "tvalue1"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py new file mode 100644 index 000000000000..99d9350b33d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py @@ -0,0 +1,48 @@ +# 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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_network_rules_create_or_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, + 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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.virtual_network_rules.begin_create_or_update( + resource_group_name="Default", + server_name="vnet-test-svr", + virtual_network_rule_name="vnet-firewall-rule", + parameters={ + "properties": { + "ignoreMissingVnetServiceEndpoint": False, + "virtualNetworkSubnetId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py new file mode 100644 index 000000000000..09063092517b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_network_rules_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.virtual_network_rules.begin_delete( + resource_group_name="Default", + server_name="vnet-test-svr", + virtual_network_rule_name="vnet-firewall-rule", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py new file mode 100644 index 000000000000..edbb19a9740e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_network_rules_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.virtual_network_rules.get( + resource_group_name="Default", + server_name="vnet-test-svr", + virtual_network_rule_name="vnet-firewall-rule", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py new file mode 100644 index 000000000000..cd4e8ac971c6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_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.sql import SqlManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python virtual_network_rules_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.virtual_network_rules.list_by_server( + resource_group_name="Default", + server_name="vnet-test-svr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json +if __name__ == "__main__": + main()